I have a collection:
{
_id - ObjectId
name - string
location - string
..
parentId - ObjectId //link to parent object
}
I have a filter query and it works nice even with int values (in C#):
var q = Query.Matches(column, new BsonRegularExpression(string.Format("/^{0}/i", name)));
What should I do in order to search by the name of parent object? Of cause, using LINQ, there is no problem, but is it possible to conduct searching on the server side?
There is not way to search by referenced object fields in mongodb. And in general monogdb is not relational database, so in my opinion it should not support any relations at all.
There is good known approach it is create additional field and store (denormalize) information on what you want search.
So, change your schema as follow to search on parent object name:
The main idea you should understand: mongodb is not realtional, no joins here, no relations.