![]()
MongoDB uses regex in certain parts of their query syntax. The following is an example of how to perform a wildcard query:
db.collectionName.find( { fieldName : /.*cnn.*/ } );
This example searches the collection for all documents with a field that contains, “%cnn%”. Of course in your query you need to replace “collectionName” with the name of your collection and “fieldName” with the field you are interested in.
