问题
How do you do the following SQL query in mongodb using the official c# Driver?
Select * from tblUser where FirstName Like '%as%'
回答1:
I figured out how to do this. You have to use Query.Matches
var query = Query.Matches("FirstName", ".*as.*");
回答2:
I'd suggest you visit this site. It has a wealth of material on the official C# driver from 10gen.
http://www.mongodb.org/display/DOCS/CSharp+Driver+Tutorial
Most answer will just reproduce what is available on the link above. If you have a specific question about problems you are having after the tutorial, please ask a more specific question.
来源:https://stackoverflow.com/questions/5709644/how-do-you-do-sql-like-operator-in-mongodb-using-the-official-c-sharp-driver