Hi,
Just as and example, say I have Collection of following items:
{
description: some descripton here
name: John Galt
status: 1
}
I would like to have text index for name and description and I want to be able to find all documents, where status equals to 1.
I create index this way:
db.collection.createIndex({“name”:“text”, 'description":“text”, “status”:1});
but I don’t get how to query the document above: say I want to search by:
$text: John
and “status”:1
I’m new to MongoDB, just 2nd day looking into it so appreciate help from community.
Thanks