SQL >> Databasteknik >  >> NoSQL >> MongoDB

Motsvarighet till mongo shell db.collection.runCommand() i Node.js

Jag hittade detta som en motsvarighet:

collection.find({ $text: { $search : "your search words" }}) .toArray(function(err,results) { // ..callback stuff.. }); 

Detta använder textindex och $text-sökning i stället för ett direkt runCommand-anrop.

  1. Läsa en fil inifrån Mongo-skalet

  2. Hur beskriver man en kollektion i MongoDB?

  3. Hämta indexinformation i PyMongo

  4. MongoDB-motsvarighet till SQL:s SELECT DISTINCT?