You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I couldn't find any example using the new MongoDB Driver (using it in PHP7 fwiw) on how to run commands such as createIndex/ensureIndex on a collection?
I tried using the executeCommand method, but it seems like it's intended only for management/administration commands, and not collection methods.
Thanks!
The text was updated successfully, but these errors were encountered:
Keep in mind that the raw driver is not meant to be used directly.
The main gateway should be the https://github.com/mongodb/mongo-php-library which contains helper methods for this sort of functionality.
Using the raw driver requires extensive knowledge of inner workings of MongoDB, and all its internal commands -- such as how to create an index.
To get you quickly running, here is how it works in MongoDB 2.6 and later:
Hello
I couldn't find any example using the new MongoDB Driver (using it in PHP7 fwiw) on how to run commands such as createIndex/ensureIndex on a collection?
I tried using the executeCommand method, but it seems like it's intended only for management/administration commands, and not collection methods.
Thanks!
The text was updated successfully, but these errors were encountered: