For example we have collection
{field: {subfield: \'name\'}}
{field: {subfield: \'phone\'}}
Can I find document without dot notation? Like
The problem is that:
db.test.find({field: {$someOperator: {subfield: /regex/}}})
Is actually another way of querying in MongoDB which uses object euqality to search for subdocuments.
So no, you must use dot notation unless you were searching for where one object exactly equals the other.
That being said you could wrap the document in $elemMatch
: http://docs.mongodb.org/manual/reference/operator/elemMatch/ that would work
Considering you collection structure $elemMatch
won't actually work.