1
I have a collection having following data:
{"_id" : ObjectId("5220222f8188d30ce85d61cc"),
“testfields”:[{ “为test_id”:1, “TEST_NAME”: “XXXX” }] }
when I query :
db.testarray.find({ "testfields" : { "$type" : 4 } })
it returns no data,but same returns data when I do:
db.testarray.find({ "$where" : "Array.isArray(this.testfields)" })
It returns data, do the type:4 identifies some other kind of list?
thanx,但我想只检查它的testfields。我无法使用$,因为它不适用于$匹配。 –