Skip to content

Find

'find' is used to match particular values of keys.

URL

  • Schema based API url

    /api/schema/user-path/instance/database/table?find={first_name:'Bob'}
    

  • schemaless API url

    /api/gen/user-path/instance/database/table?find={first_name:'Bob'}
    

{
    "find": {
        "customer_id": 2
    }
}

$lt operation

  • Find all data which has customer_id less than 2.
{
    "find": {
        "customer_id": {
            "$lt": 2
        }
    }
}

$gt operation

  • Find all data which has customer_id greater than 2.
{
    "find": {
        "customer_id": {
            "$gt": 2
        }
    }
}

$lte operation

  • Find all data which has customer_id less than or equal 2.
{
    "find": {
        "customer_id": {
            "$lte": 2
        }
    }
}

$gte operation

  • Find all data which has customer_id greater than or equal 2.
{
    "find": {
        "customer_id": {
            "$gte": 2
        }
    }
}

$eq operation

  • Find data which has customer_id equal 2.
{
    "find": {
        "customer_id": {
            "$eq": 2
        }
    }
}

$ne operation

  • Find all data which has customer_id not equal 2.
{
    "find": {
        "customer_id": {
            "$ne": 2
        }
    }
}

$not operator

  • Find all data which has owner_id is not in the given numbers of the array.
{
    "find": {
        "owner_id": {
            "$not": {
                "$in": [1, 2, 3, 4, 5, 6, 7, 8, 9]
            }
        }
    }
}

$and operation

  • Find all data which has customer_id equal to 1 and pincode equal to 382345.
{
    "find": {
        "$and": [
            {
                "customer_id": 1
            },
            {
                "pincode": 382345
            }
        ]
    }
}

$or operation

  • Find all data which has customer_id equal to 1 or pincode equal to 382345.
{
    "find": {
        "$or": [
            {
                "customer_id": 1
            },
            {
                "pincode": 382345
            }
        ]
    }
}

$nin operation

  • Find all data which has customer_id should not be in the given array values.
{
    "find": {
        "customer_id": {
            "$nin": [2, 3, 4]
        }
    }
}

$in operation

  • Find all data which has owner_id value match with given array values.
{
    "find": {
        "owner_id": {
            "$in": [1, 2]
        }
    }
}

$like operation in Custom api

  • Find all data which has first_name start match with 'Bob'.
{
    "find": {
        "first_name": {
            "$like": "Bob%"
        }
    }
}

find-join (nested find)

  • Match with deep data. The 'owner_id' and 'customer_id' both are from different collections.
{
    "find": {
        "owner_id.customer_id": 2
    }
}
  • With $and operator

    {
        "find": {
            "$and": [
                { "first_name.customer_id.customer_id": 1 },
                { "first_name.customer_id.shipping_id": 1 }
            ]
        },
        "deep": "first_name, first_name.customer_id"
    }
    

  • With $or operator

    {
        "find": {
            "$or": [
                { "first_name.customer_id.customer_id": 1 },
                { "first_name.customer_id.shipping_id": 2 }
            ]
        },
        "limit": 2
    }
    

Give string value in number field

  • customer_id has a type number. If the user provides a number in a double quote it will give the correct response.
{
    "find": {
        "customer_id": "8"
    }
}

$regex support

  • Find all data which has first_name start with the 'Sie' string.
{
    "find": {
        "first_name": {
            "$regex": "Sie%"
        }
    }
}