Examining my schema, it appears like this:
name:
value:
p_vars: {
name1: {},
name2: {},
}
My goal is to determine the number of items in p_vars
.
Assuming the interpreter is JavaScript
, I attempted the following:
db.collection.findOne().p_vars.length
However, I did not get any results.
The correct answer should be:
Based on the information provided, the answer would be 2 (two items: name1
and name2
).