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?