diff options
Diffstat (limited to 'src/mongo/gotools/test/legacy28/jstests/libs/fts.js')
-rw-r--r-- | src/mongo/gotools/test/legacy28/jstests/libs/fts.js | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/mongo/gotools/test/legacy28/jstests/libs/fts.js b/src/mongo/gotools/test/legacy28/jstests/libs/fts.js new file mode 100644 index 00000000000..73b7d339ba5 --- /dev/null +++ b/src/mongo/gotools/test/legacy28/jstests/libs/fts.js @@ -0,0 +1,18 @@ + +function queryIDS( coll, search, filter, extra ){ + var cmd = { search : search } + if ( filter ) + cmd.filter = filter; + if ( extra ) + Object.extend( cmd, extra ); + lastCommadResult = coll.runCommand( "text" , cmd); + + return getIDS( lastCommadResult ); +} + +function getIDS( commandResult ){ + if ( ! ( commandResult && commandResult.results ) ) + return [] + + return commandResult.results.map( function(z){ return z.obj._id; } ) +} |