mongo cxx parse from collection

23 views
Skip to first unread message

Ярослав Ворожбит

unread,
Nov 22, 2016, 10:25:57 AM11/22/16
to mongodb-dev
Hello dear friend. 

Have mongocxx driver parser from collection to struct or to class?

like in C#

     public IMongoCollection<Users> DBConnect()
        {

            var connectionString = "uri";
            var client = new MongoClient(connectionString);
            var database = client.GetDatabase("batabase");
            return database.GetCollection<Users>("collection");
        }   
  

Maybe I can do it in c++?

Andrew Morrow

unread,
Nov 28, 2016, 12:56:13 PM11/28/16
to mongodb-dev

Hi -

What you are describing is a C++ ODM (object-document mapping), implemented in terms of the mongocxx driver. In fact, a non-production ready (and completely unsupported) prototype of such a thing was developed by MongoDB interns over the summer:


You may find the approach taken there interesting.

Thanks,
Andrew


--
You received this message because you are subscribed to the Google Groups "mongodb-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mongodb-dev+unsubscribe@googlegroups.com.
To post to this group, send email to mongo...@googlegroups.com.
Visit this group at https://groups.google.com/group/mongodb-dev.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages