I have a simple example where the field 'created':Date is not filtrable: I get the following error message
graphQl error : Field "created" is not defined by type FilterFindOneentitygroupstathistoryOperatorsInput.
Here's my mongoose schema:
import mongoose, {Schema} from 'mongoose';
const EntityGroupStatHistory = new Schema({
_id: {type: String, required: true, unique: true},
entityGroupId: String,
commentCount: Number,
commentUserCount: Number,
empathyCount: Number,
joinedCount: Number,
created: Date,
visitStats: [{_id: 'ObjectId', totalVisits: Number}]
})
created is indexed but not unique
export default mongoose.model('entitygroupstathistory', EntityGroupStatHistory)
Actually, the plugin doesn't look into indexes in the db, it only looks at the mongoose definition.
modifying the schema this way fixed the issue:
created: {type:Date, index: true},
Hi,
I have a simple example where the field 'created':Date is not filtrable: I get the following error message
graphQl error : Field "created" is not defined by type FilterFindOneentitygroupstathistoryOperatorsInput.
Here's my mongoose schema:The query that fails s this:
More details: Actually the table is a materialized view created by this script:
And here's a sample document: