Project Page
Source Code
Issues
Adds a wildcard search to the mongodb shell. You can run the new wild() function on a collection, or on a query result. The search is performed by converting each document to json, and then running a regex on that json.
// Search entire users collection for Bob
db.users.wild('Bob');
db.users.wild(/Bob/gi);
db.users.find().wild('Bob');
// Search for exact values of 'Bob'
db.users.wild(': "Bob"');
// Search for exact keys called 'Bob'
db.users.wild('"Bob" :');
// Search for documents containing 'Bob', filtering by last name of 'Smith'
db.users.wild('Bob', {'name.last' : 'Smith'});
db.users.find({'name.last' : 'Smith'}).wild('Bob');
Download: wild.js
Add this script to your .mongorc.js file.
Start the shell after executing this script
mongo --shell wild.js