summaryrefslogtreecommitdiff
path: root/jstests/libs/fts.js
blob: 73b7d339ba50a1dbe937e52372f07b361ee17488 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
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; } )
}