-
Notifications
You must be signed in to change notification settings - Fork 213
Closed
Labels
Description
Hello,
Web development beginner, I'm trying to convert a code to access MongoDB using MongoDB\Driver\Manager, but have some difficulties. Indeed, this new driver seems to me a little bit low-level compared to the previous one so it can be a bit complicated to work with...
$mongoConn = new MongoClient("mongodb://localhost:27017");
$mongoDB = $mongoConn->selectDataBase(dbname1);//dbname2 exists too
...
$index = new MongoDBIndexation($mongoDB);//our class for using
If it is ok that I must begin with:
$mongoConn = new MongoDB\Driver\Manager("mongodb://localhost:27017");
How to continue with $mongoDB, please?
And what are the equivalents of:
$collection->remove
$collection->save and
$collection->findOne ?
Thanks in advance