Query and filter key names instead of values in MongoDB

Viewed 9071

I want to find all key names from a collection that partially match a certain string.

The closest I got was to check if a certain key exists, but that's an exact match:

db.collection.find({ "fkClientID": { $exists:1 }})

I'd like to get all keys that start with fk instead.

2 Answers
Related