Meanwhile in the shell the way you can get all distinct values of a field is with command:
> db.collection.distinct("fieldname")
Asya
var collection = new MongoClient(@"mongodb://localhost/MAM").GetServer()
.GetDatabase("MAM")
.GetCollection<iLogEntry>("LogsCollection");
foreach (var item in collection.FindAll())
{}
collection.FindAs<X>(Query.EQ("_t", typeof(X).Name))
But with about 20 kinds of objects this doesnt look very good.
Hi there....first of all i am a newB working with mongodb.i am trying to Find Documents in a Collection.This Collection has many different Document Types.Now there is the Fact that i just know some of those.Example: in the collection there are Docs with the discriminators _t {'a','b','c','d'}I just know 'a' and 'b'.Now i just want to Find my known Types, but getting the Exeception "Unknown discriminator value",How can i just read my known Types or prevent from getting the exception?I hoped i desribed my problem,so you can understand it.Thanks alot for reading or helping me...
--
--
You received this message because you are subscribed to the Google
Groups "mongodb-user" group.
To post to this group, send email to mongod...@googlegroups.com
To unsubscribe from this group, send email to
mongodb-user...@googlegroups.com
See also the IRC channel -- freenode.net#mongodb
---
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...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.