ReferenceMany Unable to find _id #8801
-
|
I have user Model, which reference to ListedStocks, But when i try to Create a user and pass an Array of Stocks _id, it gives me an error. shouldn't Or am i missing something? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
|
The Issue was in the constraint created by the The constraint Complete Fix is Below. NOTE: This fix is specifically for the MongoDB, not sure if this breaks SQL Based Repos |
Beta Was this translation helpful? Give feedback.
The Issue was in the constraint created by the
createReferencesManyAccessorThe constraint
const constraint: any = {[primaryKey]: foreignKeyValue};should have been
constraint = {[primaryKey]: {inq:foreignKeyValue}};Complete Fix is Below.
NOTE: This fix is specifically for the MongoDB, not sure if this breaks SQL Based Repos