loopbackio / loopbackio/loopback-next
Where filter with `neq` doesnot work as expected
Offen
@hacksparrow arbeitet bereits daran.
Seit 20.10.2020.
bug
needs steps to reproduce
- Vorherrschende Sprache
- TypeScript
- Sterne
- 5.1k
- Forks
- 1.1k
- Ø Merge
- 2 T. 21 Std.
- Gemergte PRs (30 T.)
- 27
Beschreibung
Steps to reproduce
- Create a entity has
idproperty as the following
class Sample extends Entity {
@property({
type: 'string',
id: true,
generated: true,
})
id?: string;
// other properties
}
- Make a query to find samples that not equal the
id. For example
const id = '5f7f32799f3b8031a56e4ca8';
const result = this.sampleRepositoy.find(
{
where: {
id: {
neq: id
}
}
}
)
Current Behavior
result still has the entity with id='5f7f32799f3b8031a56e4ca8'
Expected Behavior
result should exclude the id that I used to filter.
I am using mongo with package: "loopback-connector-mongodb: 5.3.0"
Everything will work if I try to install "mongodb" package and replace neq: id with neq: new ObjectId(id)
Beitragsleitfaden
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Bewertung
Dieses Issue wurde noch nicht bewertet.