Zoclee / xojo-mongodb

MongoDB driver for Xojo.
15 stars 5 forks source link

db.coll.findOne() request #2

Closed ghost closed 10 years ago

ghost commented 10 years ago

The driver provides the 4 basic MongoDB operations: insert(), find(), update() and remove(). This is nice but one is missing that's important for MongoDB logic: findOne().

It's documented here: http://docs.mongodb.org/manual/reference/method/db.collection.findOne/

It would be nice if you could implement this one too - to use the xojo driver with same logic used for other drivers (mainly nodejs, python and php).

alwyn1024 commented 10 years ago

This is already implemented. Have a look at the MongoCollection class, and you will see there are two methods "find()" and "findOne()".

To make use of findOne() simply call the method using your collection instance, e.g.:

MyCollection.findOne("{a:1}")