Trying to use the Query Builder with the C# Driver

From: False McFakeman <falsemcfakeman@xxxxxxxxx>
To: mongodb-user <mongodb-user@xxxxxxxxxxxxxxxx>
Date: Tue, 3 May 2016 19:17:14 -0700 (PDT)
Why ads?
Okay, so I'm trying to compile a program on Ubuntu using Mono, and this is 
the command I'm using:

gmcs main.cs mongo.cs -r:MongoDB.Bson.dll -r:MongoDB.Driver.dll 
-r:MongoDB.Driver.Core.dll

I'm just trying to query with the QueryBuilder, but it's telling me things 
like '*The name `Query' does not exist in the current context*'... Unless I 
try to include MongoDB.Driver.Builders, then it gives me this error instead:

*mongo.cs(3,22): error CS0305: Using the generic type 
`MongoDB.Driver.Builders<TDocument>' requires `1' type argument(s)*

But I'm just trying to include a namespace... Notice how it's throwing the 
error on line 3...

I'm trying to do something like this:

using MongoDB.Bson;
using MongoDB.Driver;
using MongoDB.Driver.Builders;
using MongoDB.Driver.Linq;

// etc.


var collection = _database.GetCollection<BsonDocument>("users");

var query = Query.And( 
  Query.EQ("username", username), 
  Query.EQ("password", password) 
); 
var fields = Fields.Include("username"); 
var user = 
collection.Find(query).SetFields(fields).SetLimit(1).FirstOrDefault();

Type currentType = user.GetType();
return currentType.ToString();

-----

Thanks for any guideance, even if just pointing me to another way to do 
this that won't error me out.

-- 
You received this message because you are subscribed to the Google Groups "mongodb-user"
group.

For other MongoDB technical support options, see: https://docs.mongodb.org/manual/support/
--- 
You received this message because you are subscribed to the Google Groups "mongodb-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mongodb-user+unsubscribe@xxxxxxxxxxxxxxxx.
To post to this group, send email to mongodb-user@xxxxxxxxxxxxxxxx.
Visit this group at https://groups.google.com/group/mongodb-user.
To view this discussion on the web visit https://groups.google.com/d/msgid/mongodb-user/164d7dec-ef6d-4749-84c4-b6f6dde11779%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Why ads?