You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While using the new HotChocolate PRISMA-inspired Filter package on top of a Mongo database I encountered the following error when using the booleanProperty_not Filter:
({document}{IsCapitalCity} == False) is not supported.
In short, this works:
{
cities(where: { isCapitalCity: true }){
name
}
}
while this does not:
{
cities(where: { isCapitalCity_not: false }){
name
}
}
Note: This works:
{
cities(where: { isCapitalCity: false }){
name
}
}
To Reproduce
Declare the following query type:
public class QueryType: ObjectType
{
protected override void Configure(IObjectTypeDescriptor descriptor)
{
descriptor.Name("Query");
descriptor.Field("cities")
.Resolver(ctx => ctx.Service<IMongoCollection<City>>().AsQueryable())
.UseFiltering<CityFilterType>();
}
}
And initialize the City collection in the services:
services.AddSingleton(sp =>
{
var client = new MongoClient();
IMongoDatabase database = client.GetDatabase(
"db_" + Guid.NewGuid().ToString("N"));
IMongoCollection<City> collection
= database.GetCollection<City>("col");
collection.InsertMany(new[]
{
new City(1, "Amsterdam", "nl", true),
new City(2, "Berlin", "de", true),
new City(3, "Paris", "fr", true),
new City(4, "Zürich", "ch", false)
});
return collection;
});
While using the new HotChocolate PRISMA-inspired Filter package on top of a Mongo database I encountered the following error when using the booleanProperty_not Filter:
In short, this works:
while this does not:
Note: This works:
To Reproduce
Declare the following query type:
And initialize the City collection in the services:
I commited a sample repo here: https://github.com/gmiserez/HotChocolate_BooleanNotFilterAgainstMongo
(needs a local Mongo instance listening to port 27017)
Expected behavior
cities(where: { isCapitalCity_not: false })
should return the same result set thancities(where: { isCapitalCity: true })
Packages:
The text was updated successfully, but these errors were encountered: