how to find any document in database with an object id with mongoose?

I have some relational records in some collections. I use object ids for this. And I want to find an object with without collection find functions.

Is it possible to use a global find function on db like this?

db.globalfind({_id:"12345678901234567890"});

Operations in MongoDB only always work on one collection. If you want to do a find on multiple collections, then you need to run multiple queries - one per collection. Of course, it's quite for Mongoose to implement a convenience function for that, but I don't think it has, or should, as it is against one of MongoDB's paradigms.

MongoDB doesn't really support getting an arbitrary document based on it's objectID. However you can use the code below that searches the entire database:

var objectID = ObjectId("53623db53004e212edcc8fe6");
var findMultiple = true;

// ----------------------- code -----------------------
var stack = [];
db.getCollectionNames().forEach(function(collName) {
    var docs = db.getCollection(collName).find(); 
    docs.forEach(function(doc) {
        doc._FROM = collName;
        stack.push(doc);
    });
});

while(stack.length > 0) {
    var doc = stack.pop();
    if(doc._id) {
        if(doc._id.toString() === objectID.toString()) {
            print(doc);
            if(!findMultiple) {
                stack = [];
            }
        }
    }
    for (var property in doc) {
        var value = doc[property];
        var type = Object.prototype.toString.call(value);
        if (type === '[object Object]' || type === '[object Array]' || type ==='[object bson_object]') {
            value._FROM = doc._FROM + "/" + property;
            stack.push(value);
        }
    }
}