I have to somehow set a wildcard in one of the keys of my mongodb request. To *.files.FileIDalso check the following keys of my document: root.files.FileID root.folders.0.files.FileID
*.files.FileID
root.files.FileID
root.folders.0.files.FileID
My attempt was to simply do this: db.user_folders.find({ '*.files.FileID' : 6 }) But it does not return any results.
db.user_folders.find({ '*.files.FileID' : 6 })
The only query operators that act on document fields (as opposed to the value of these fields) are $existsand $type.
$exists
$type
There are basically two ways: