Soul
Soul

Reputation: 83

How to execute raw query in jenssegers/laravel-mongodb

I'm looking to make a query that gets all the existing indexes of a collection.

I have tried the following code:

DB::connection('mongodb')->getMongoDB()->execute("db.registrations.getIndexes()")

But getting error

Call to undefined method MongoDB\Database::execute()

How do I execute raw queries on this library?

Thanks

Upvotes: 1

Views: 480

Answers (0)

Related Questions