diff options
Diffstat (limited to 'src/mongo/gotools/test/qa-tests/jstests/libs/fts.js')
-rw-r--r-- | src/mongo/gotools/test/qa-tests/jstests/libs/fts.js | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/mongo/gotools/test/qa-tests/jstests/libs/fts.js b/src/mongo/gotools/test/qa-tests/jstests/libs/fts.js new file mode 100644 index 00000000000..0da80d5d3ae --- /dev/null +++ b/src/mongo/gotools/test/qa-tests/jstests/libs/fts.js @@ -0,0 +1,22 @@ +function getIDS(commandResult) { + if (!(commandResult && commandResult.results)) { + return []; + } + + return commandResult.results.map(function(z) { + return z.obj._id; + }); +} + +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); +} |