Monsoose populating problem

27 views
Skip to first unread message

Luka Obuljen

unread,
Jul 14, 2017, 6:21:08 AM7/14/17
to Mongoose Node.JS ODM
Hello,

I have problem with Mongoose populating function (maybe it's not problem in populate).
In around 2-3% of running same query I got fields with null and empty array.

Here is my script:
operationsDefinitionsModel.findOne({ id: assemblyId, customer: value_3.customer }).populate({
path: 'operations_segments',
populate: {
path: 'personnel_specifications nested_segments',
populate: {
path: 'specification_properties person'
}
}
}).
exec(function (err, assembly) {

And this part of code I'm executing in loop. For exampme with same id and same customer from 100 looped queries I got 2-3 situations when I don't have specification_properties and person populated (I have null for person and empty array for specification_properties.
On scheme everything is good because for around 97 loop runs I got values.

I really don't know what to do and why this is happening?
Any idea?

Thanks
Reply all
Reply to author
Forward
0 new messages