Hi Sunitha, Thank you for the question, and I am happy that you're succesfully using MM to query mongo.
But I'm affraid you're looking for something that goes beyond the scope of MetaModel then. Probably the plain Java driver for MongoDB allows you to call ensureIndex(...) somehow? The purpose of MetaModel isn't to expose *all *the functionality of every datastore, but rather provide a uniform interface for the stuff that they have in common. Adding something specifically for a function like ensureIndex(...) would be an abstraction leak for us. Rather we try to make your code portable to multiple datastore types, and obviously ensureIndex(...) cannot be ported to e.g. a CSV file or a relational database. Regards, Kasper 2013/9/16 Sunitha Karthikeyan <[email protected]> > Hi , > > I am planning to use ApacheMetamodel for Querying MongoDB. > > I am able to perform the CRUD operation via createMongoDbDataContext. > > Native SQL Query can be executed via dataContext.parseQuery. > > I am struck in setting unique index on a table {collection} > > Would like to know if we can run this query through an api call > > db.people.ensureIndex( { "id": 1 } ) > > Regards, > Sunitha >
