mongodb get pairs of user ids that follow parameters code example Example: mongo find documents that have a certain key db.coll.find({"mykey":{'$exists': 1}})