--- Operator MongoDB

. 1, $ type operator

    1.1, $ type to retrieve the set of data types based on matching the type of BSON, and returns the result;

            The BSON : one kind of computer data interchange format , is used mainly as  a MongoDB database   in data storage and network transmission format;

                It is a binary representation , the data can be used to represent a simple structure, associative array (MongoDB referred to as "object" or "document") and MongoDB various data types;

                BSON name due to JSON, meaning Binary JSON (binary JSON);

           eg:db.col.find({"title" : {$type : 'string'}});

2, conditions operation marks

    2.1, (>) is greater than - $ gt

    2.2 (<) is less than - $ lt

    2.3 (> =) or greater - $ gte

    2.4 (<=) or less - $ lte

        eg:db.col.find({likes : {$gt : 100}})      、db.col.find({likes : {$lt :200, $gt : 100}})

Guess you like

Origin www.cnblogs.com/anpeiyong/p/12504856.html