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
Distinct returns an array of ObjectIDs rather than an array of Models, which appears to confuse the caching mechanism. Is there any way to fix it easily?
The text was updated successfully, but these errors were encountered:
I've just come across this - each ObjectId in the array gets converted to an object of the relevant Model, where the object has keys of numbers from 0 to 23 and the values are the 24 characters of the ObjectId. It also includes any fields Mongoose would include in an object of the Model, e.g. fields defined in the schema with defaults or as an array.
{
'0': '5',
'1': 'd',
'2': 'c',
'3': '1',
'4': '5',
// ...and so on for the whole ObjectId
someArrayFieldInSchema: [],
someFieldWithDefault: 0
}
Somewhat similar to #25.
Distinct returns an array of ObjectIDs rather than an array of Models, which appears to confuse the caching mechanism. Is there any way to fix it easily?
The text was updated successfully, but these errors were encountered: