Skip to content
This page View Markdown Open in ChatGPT Open in Claude

Remove by query

The code in every language

Each example is the inside of main, written in every language API Maker runs : pick yours in the tabs, and every page shows it from then on. The types a call takes (GetAll, DeepItem…) are those of am : from am import GetAll in Python, use am::GetAll; in Rust, import am.GetAll; in Java and Kotlin ; PHP and C# have them without an import, Go names them am.GetAll.

g.sys.db.removeByQuery calls the remove by query schema API of any table from your code, with the same headers and query parameters as over HTTP. It returns the data. The whole envelope (success, statusCode, data, totalCount, errors…) comes back when true is passed as the second argument in TypeScript, and through full in the other languages : g.sys.db.full (g.Sys.Db.Full in C# and Go, $g->sys->db->full in PHP).

Simple removeByQuery

Remove by query
1
2
3
4
5
6
let updateById = await g.sys.db.removeByQuery({
    instance: "mysql_8", database: "inventory", collection: "customers",
    find: {
        "first_name": "Bob"
    }
});
Remove by query
1
2
3
4
5
6
update_by_id = await g.sys.db.remove_by_query(
    'mysql_8', 'inventory', 'customers',
    find={
        'first_name': 'Bob',
    },
)
Remove by query
1
2
3
4
5
6
$updateById = $g->sys->db->removeByQuery(
    'mysql_8', 'inventory', 'customers',
    find: [
        'first_name' => 'Bob',
    ],
);
Remove by query
1
2
3
4
5
6
7
var updateById = await g.Sys.Db.RemoveByQuery(new RemoveByQuery("mysql_8", "inventory", "customers")
{
    Find = new JsonObject
    {
        ["first_name"] = "Bob",
    },
});
Remove by query
1
2
3
4
5
6
7
8
9
updateById, err := g.Sys.Db.RemoveByQuery(am.RemoveByQuery{
    Instance: "mysql_8", Database: "inventory", Collection: "customers",
    Find: am.M{
        "first_name": "Bob",
    },
})
if err != nil {
    return nil, err
}
Remove by query
1
2
3
4
5
6
let update_by_id = g.sys.db.remove_by_query(
    RemoveByQuery::new("mysql_8", "inventory", "customers")
        .find(json!({
            "first_name": "Bob",
        })),
)?;
Remove by query
1
2
3
4
var updateById = g.sys.db.removeByQuery(new RemoveByQuery("mysql_8", "inventory", "customers")
    .find(Map.of(
        "first_name", "Bob"
    )));
Remove by query
1
2
3
4
5
6
val updateById = g.sys.db.removeByQuery(
    RemoveByQuery("mysql_8", "inventory", "customers")
        .find(mapOf(
            "first_name" to "Bob",
        )),
)

removeByQuery with headers

Remove by query with headers
1
2
3
4
5
6
7
8
9
let updateById = await g.sys.db.removeByQuery({
    instance: "mysql_8", database: "inventory", collection: "customers",
    find: {
        "first_name": "Bob"
    },
    headers: {
        "x-am-response-case": "capitalCase", // noChange | camelCase | capitalCase | constantCase | dotCase | headerCase | noCase | paramCase | pascalCase | pathCase | sentenceCase | snakeCase
    },
});
Remove by query with headers
1
2
3
4
5
6
7
8
9
update_by_id = await g.sys.db.remove_by_query(
    'mysql_8', 'inventory', 'customers',
    find={
        'first_name': 'Bob',
    },
    headers={
        'x-am-response-case': 'capitalCase',  # noChange | camelCase | capitalCase | constantCase | dotCase | headerCase | noCase | paramCase | pascalCase | pathCase | sentenceCase | snakeCase
    },
)
Remove by query with headers
1
2
3
4
5
6
7
8
9
$updateById = $g->sys->db->removeByQuery(
    'mysql_8', 'inventory', 'customers',
    find: [
        'first_name' => 'Bob',
    ],
    headers: [
        'x-am-response-case' => 'capitalCase', // noChange | camelCase | capitalCase | constantCase | dotCase | headerCase | noCase | paramCase | pascalCase | pathCase | sentenceCase | snakeCase
    ],
);
Remove by query with headers
var updateById = await g.Sys.Db.RemoveByQuery(new RemoveByQuery("mysql_8", "inventory", "customers")
{
    Find = new JsonObject
    {
        ["first_name"] = "Bob",
    },
    Headers = new JsonObject
    {
        ["x-am-response-case"] = "capitalCase", // noChange | camelCase | capitalCase | constantCase | dotCase | headerCase | noCase | paramCase | pascalCase | pathCase | sentenceCase | snakeCase
    },
});
Remove by query with headers
updateById, err := g.Sys.Db.RemoveByQuery(am.RemoveByQuery{
    Instance: "mysql_8", Database: "inventory", Collection: "customers",
    Find: am.M{
        "first_name": "Bob",
    },
    Headers: am.M{
        "x-am-response-case": "capitalCase", // noChange | camelCase | capitalCase | constantCase | dotCase | headerCase | noCase | paramCase | pascalCase | pathCase | sentenceCase | snakeCase
    },
})
if err != nil {
    return nil, err
}
Remove by query with headers
1
2
3
4
5
6
7
8
9
let update_by_id = g.sys.db.remove_by_query(
    RemoveByQuery::new("mysql_8", "inventory", "customers")
        .find(json!({
            "first_name": "Bob",
        }))
        .headers(json!({
            "x-am-response-case": "capitalCase", // noChange | camelCase | capitalCase | constantCase | dotCase | headerCase | noCase | paramCase | pascalCase | pathCase | sentenceCase | snakeCase
        })),
)?;
Remove by query with headers
1
2
3
4
5
6
7
var updateById = g.sys.db.removeByQuery(new RemoveByQuery("mysql_8", "inventory", "customers")
    .find(Map.of(
        "first_name", "Bob"
    ))
    .headers(Map.of(
        "x-am-response-case", "capitalCase" // noChange | camelCase | capitalCase | constantCase | dotCase | headerCase | noCase | paramCase | pascalCase | pathCase | sentenceCase | snakeCase
    )));
Remove by query with headers
1
2
3
4
5
6
7
8
9
val updateById = g.sys.db.removeByQuery(
    RemoveByQuery("mysql_8", "inventory", "customers")
        .find(mapOf(
            "first_name" to "Bob",
        ))
        .headers(mapOf(
            "x-am-response-case" to "capitalCase", // noChange | camelCase | capitalCase | constantCase | dotCase | headerCase | noCase | paramCase | pascalCase | pathCase | sentenceCase | snakeCase
        )),
)

$lt removeByQuery

$lt Remove by query
1
2
3
4
5
6
7
8
let updateById = await g.sys.db.removeByQuery({
    instance: "mysql_8", database: "inventory", collection: "customers",
    find: {
        customer_id: {
            "$lt": 2
        }
    }
});
$lt Remove by query
1
2
3
4
5
6
7
8
update_by_id = await g.sys.db.remove_by_query(
    'mysql_8', 'inventory', 'customers',
    find={
        'customer_id': {
            '$lt': 2,
        },
    },
)
$lt Remove by query
1
2
3
4
5
6
7
8
$updateById = $g->sys->db->removeByQuery(
    'mysql_8', 'inventory', 'customers',
    find: [
        'customer_id' => [
            '$lt' => 2,
        ],
    ],
);
$lt Remove by query
var updateById = await g.Sys.Db.RemoveByQuery(new RemoveByQuery("mysql_8", "inventory", "customers")
{
    Find = new JsonObject
    {
        ["customer_id"] = new JsonObject
        {
            ["$lt"] = 2,
        },
    },
});
$lt Remove by query
updateById, err := g.Sys.Db.RemoveByQuery(am.RemoveByQuery{
    Instance: "mysql_8", Database: "inventory", Collection: "customers",
    Find: am.M{
        "customer_id": am.M{
            "$lt": 2,
        },
    },
})
if err != nil {
    return nil, err
}
$lt Remove by query
1
2
3
4
5
6
7
8
let update_by_id = g.sys.db.remove_by_query(
    RemoveByQuery::new("mysql_8", "inventory", "customers")
        .find(json!({
            "customer_id": {
                "$lt": 2,
            },
        })),
)?;
$lt Remove by query
1
2
3
4
5
6
var updateById = g.sys.db.removeByQuery(new RemoveByQuery("mysql_8", "inventory", "customers")
    .find(Map.of(
        "customer_id", Map.of(
            "$lt", 2
        )
    )));
$lt Remove by query
1
2
3
4
5
6
7
8
val updateById = g.sys.db.removeByQuery(
    RemoveByQuery("mysql_8", "inventory", "customers")
        .find(mapOf(
            "customer_id" to mapOf(
                "\$lt" to 2,
            ),
        )),
)

$lte removeByQuery

$lte Remove by query
1
2
3
4
5
6
7
8
let updateById = await g.sys.db.removeByQuery({
    instance: "mysql_8", database: "inventory", collection: "customers",
    find: {
        customer_id: {
            "$lte": 2
        }
    }
});
$lte Remove by query
1
2
3
4
5
6
7
8
update_by_id = await g.sys.db.remove_by_query(
    'mysql_8', 'inventory', 'customers',
    find={
        'customer_id': {
            '$lte': 2,
        },
    },
)
$lte Remove by query
1
2
3
4
5
6
7
8
$updateById = $g->sys->db->removeByQuery(
    'mysql_8', 'inventory', 'customers',
    find: [
        'customer_id' => [
            '$lte' => 2,
        ],
    ],
);
$lte Remove by query
var updateById = await g.Sys.Db.RemoveByQuery(new RemoveByQuery("mysql_8", "inventory", "customers")
{
    Find = new JsonObject
    {
        ["customer_id"] = new JsonObject
        {
            ["$lte"] = 2,
        },
    },
});
$lte Remove by query
updateById, err := g.Sys.Db.RemoveByQuery(am.RemoveByQuery{
    Instance: "mysql_8", Database: "inventory", Collection: "customers",
    Find: am.M{
        "customer_id": am.M{
            "$lte": 2,
        },
    },
})
if err != nil {
    return nil, err
}
$lte Remove by query
1
2
3
4
5
6
7
8
let update_by_id = g.sys.db.remove_by_query(
    RemoveByQuery::new("mysql_8", "inventory", "customers")
        .find(json!({
            "customer_id": {
                "$lte": 2,
            },
        })),
)?;
$lte Remove by query
1
2
3
4
5
6
var updateById = g.sys.db.removeByQuery(new RemoveByQuery("mysql_8", "inventory", "customers")
    .find(Map.of(
        "customer_id", Map.of(
            "$lte", 2
        )
    )));
$lte Remove by query
1
2
3
4
5
6
7
8
val updateById = g.sys.db.removeByQuery(
    RemoveByQuery("mysql_8", "inventory", "customers")
        .find(mapOf(
            "customer_id" to mapOf(
                "\$lte" to 2,
            ),
        )),
)

$gt removeByQuery

$gt Remove by query
1
2
3
4
5
6
7
8
let updateById = await g.sys.db.removeByQuery({
    instance: "mysql_8", database: "inventory", collection: "customers",
    find: {
        customer_id: {
            "$gt": 2
        }
    }
});
$gt Remove by query
1
2
3
4
5
6
7
8
update_by_id = await g.sys.db.remove_by_query(
    'mysql_8', 'inventory', 'customers',
    find={
        'customer_id': {
            '$gt': 2,
        },
    },
)
$gt Remove by query
1
2
3
4
5
6
7
8
$updateById = $g->sys->db->removeByQuery(
    'mysql_8', 'inventory', 'customers',
    find: [
        'customer_id' => [
            '$gt' => 2,
        ],
    ],
);
$gt Remove by query
var updateById = await g.Sys.Db.RemoveByQuery(new RemoveByQuery("mysql_8", "inventory", "customers")
{
    Find = new JsonObject
    {
        ["customer_id"] = new JsonObject
        {
            ["$gt"] = 2,
        },
    },
});
$gt Remove by query
updateById, err := g.Sys.Db.RemoveByQuery(am.RemoveByQuery{
    Instance: "mysql_8", Database: "inventory", Collection: "customers",
    Find: am.M{
        "customer_id": am.M{
            "$gt": 2,
        },
    },
})
if err != nil {
    return nil, err
}
$gt Remove by query
1
2
3
4
5
6
7
8
let update_by_id = g.sys.db.remove_by_query(
    RemoveByQuery::new("mysql_8", "inventory", "customers")
        .find(json!({
            "customer_id": {
                "$gt": 2,
            },
        })),
)?;
$gt Remove by query
1
2
3
4
5
6
var updateById = g.sys.db.removeByQuery(new RemoveByQuery("mysql_8", "inventory", "customers")
    .find(Map.of(
        "customer_id", Map.of(
            "$gt", 2
        )
    )));
$gt Remove by query
1
2
3
4
5
6
7
8
val updateById = g.sys.db.removeByQuery(
    RemoveByQuery("mysql_8", "inventory", "customers")
        .find(mapOf(
            "customer_id" to mapOf(
                "\$gt" to 2,
            ),
        )),
)

$gte removeByQuery

$gte Remove by query
1
2
3
4
5
6
7
8
let updateById = await g.sys.db.removeByQuery({
    instance: "mysql_8", database: "inventory", collection: "customers",
    find: {
        customer_id: {
            "$gte": 2
        }
    }
});
$gte Remove by query
1
2
3
4
5
6
7
8
update_by_id = await g.sys.db.remove_by_query(
    'mysql_8', 'inventory', 'customers',
    find={
        'customer_id': {
            '$gte': 2,
        },
    },
)
$gte Remove by query
1
2
3
4
5
6
7
8
$updateById = $g->sys->db->removeByQuery(
    'mysql_8', 'inventory', 'customers',
    find: [
        'customer_id' => [
            '$gte' => 2,
        ],
    ],
);
$gte Remove by query
var updateById = await g.Sys.Db.RemoveByQuery(new RemoveByQuery("mysql_8", "inventory", "customers")
{
    Find = new JsonObject
    {
        ["customer_id"] = new JsonObject
        {
            ["$gte"] = 2,
        },
    },
});
$gte Remove by query
updateById, err := g.Sys.Db.RemoveByQuery(am.RemoveByQuery{
    Instance: "mysql_8", Database: "inventory", Collection: "customers",
    Find: am.M{
        "customer_id": am.M{
            "$gte": 2,
        },
    },
})
if err != nil {
    return nil, err
}
$gte Remove by query
1
2
3
4
5
6
7
8
let update_by_id = g.sys.db.remove_by_query(
    RemoveByQuery::new("mysql_8", "inventory", "customers")
        .find(json!({
            "customer_id": {
                "$gte": 2,
            },
        })),
)?;
$gte Remove by query
1
2
3
4
5
6
var updateById = g.sys.db.removeByQuery(new RemoveByQuery("mysql_8", "inventory", "customers")
    .find(Map.of(
        "customer_id", Map.of(
            "$gte", 2
        )
    )));
$gte Remove by query
1
2
3
4
5
6
7
8
val updateById = g.sys.db.removeByQuery(
    RemoveByQuery("mysql_8", "inventory", "customers")
        .find(mapOf(
            "customer_id" to mapOf(
                "\$gte" to 2,
            ),
        )),
)

$eq removeByQuery

$eq Remove by query
1
2
3
4
5
6
7
8
let updateById = await g.sys.db.removeByQuery({
    instance: "mysql_8", database: "inventory", collection: "customers",
    find: {
        customer_id: {
            "$eq": 2
        }
    }
});
$eq Remove by query
1
2
3
4
5
6
7
8
update_by_id = await g.sys.db.remove_by_query(
    'mysql_8', 'inventory', 'customers',
    find={
        'customer_id': {
            '$eq': 2,
        },
    },
)
$eq Remove by query
1
2
3
4
5
6
7
8
$updateById = $g->sys->db->removeByQuery(
    'mysql_8', 'inventory', 'customers',
    find: [
        'customer_id' => [
            '$eq' => 2,
        ],
    ],
);
$eq Remove by query
var updateById = await g.Sys.Db.RemoveByQuery(new RemoveByQuery("mysql_8", "inventory", "customers")
{
    Find = new JsonObject
    {
        ["customer_id"] = new JsonObject
        {
            ["$eq"] = 2,
        },
    },
});
$eq Remove by query
updateById, err := g.Sys.Db.RemoveByQuery(am.RemoveByQuery{
    Instance: "mysql_8", Database: "inventory", Collection: "customers",
    Find: am.M{
        "customer_id": am.M{
            "$eq": 2,
        },
    },
})
if err != nil {
    return nil, err
}
$eq Remove by query
1
2
3
4
5
6
7
8
let update_by_id = g.sys.db.remove_by_query(
    RemoveByQuery::new("mysql_8", "inventory", "customers")
        .find(json!({
            "customer_id": {
                "$eq": 2,
            },
        })),
)?;
$eq Remove by query
1
2
3
4
5
6
var updateById = g.sys.db.removeByQuery(new RemoveByQuery("mysql_8", "inventory", "customers")
    .find(Map.of(
        "customer_id", Map.of(
            "$eq", 2
        )
    )));
$eq Remove by query
1
2
3
4
5
6
7
8
val updateById = g.sys.db.removeByQuery(
    RemoveByQuery("mysql_8", "inventory", "customers")
        .find(mapOf(
            "customer_id" to mapOf(
                "\$eq" to 2,
            ),
        )),
)

$ne removeByQuery

$ne Remove by query
1
2
3
4
5
6
7
8
let updateById = await g.sys.db.removeByQuery({
    instance: "mysql_8", database: "inventory", collection: "customers",
    find: {
        customer_id: {
            "$ne": 2
        }
    }
});
$ne Remove by query
1
2
3
4
5
6
7
8
update_by_id = await g.sys.db.remove_by_query(
    'mysql_8', 'inventory', 'customers',
    find={
        'customer_id': {
            '$ne': 2,
        },
    },
)
$ne Remove by query
1
2
3
4
5
6
7
8
$updateById = $g->sys->db->removeByQuery(
    'mysql_8', 'inventory', 'customers',
    find: [
        'customer_id' => [
            '$ne' => 2,
        ],
    ],
);
$ne Remove by query
var updateById = await g.Sys.Db.RemoveByQuery(new RemoveByQuery("mysql_8", "inventory", "customers")
{
    Find = new JsonObject
    {
        ["customer_id"] = new JsonObject
        {
            ["$ne"] = 2,
        },
    },
});
$ne Remove by query
updateById, err := g.Sys.Db.RemoveByQuery(am.RemoveByQuery{
    Instance: "mysql_8", Database: "inventory", Collection: "customers",
    Find: am.M{
        "customer_id": am.M{
            "$ne": 2,
        },
    },
})
if err != nil {
    return nil, err
}
$ne Remove by query
1
2
3
4
5
6
7
8
let update_by_id = g.sys.db.remove_by_query(
    RemoveByQuery::new("mysql_8", "inventory", "customers")
        .find(json!({
            "customer_id": {
                "$ne": 2,
            },
        })),
)?;
$ne Remove by query
1
2
3
4
5
6
var updateById = g.sys.db.removeByQuery(new RemoveByQuery("mysql_8", "inventory", "customers")
    .find(Map.of(
        "customer_id", Map.of(
            "$ne", 2
        )
    )));
$ne Remove by query
1
2
3
4
5
6
7
8
val updateById = g.sys.db.removeByQuery(
    RemoveByQuery("mysql_8", "inventory", "customers")
        .find(mapOf(
            "customer_id" to mapOf(
                "\$ne" to 2,
            ),
        )),
)

$not removeByQuery

$not Remove by query
let updateById = await g.sys.db.removeByQuery({
    instance: "mysql_8", database: "inventory", collection: "customers",
    find: {
        customer_id: {
            "$not": {
                "$in": [1, 2, 3, 4]
            }
        }
    }
});
$not Remove by query
update_by_id = await g.sys.db.remove_by_query(
    'mysql_8', 'inventory', 'customers',
    find={
        'customer_id': {
            '$not': {
                '$in': [1, 2, 3, 4],
            },
        },
    },
)
$not Remove by query
$updateById = $g->sys->db->removeByQuery(
    'mysql_8', 'inventory', 'customers',
    find: [
        'customer_id' => [
            '$not' => [
                '$in' => [1, 2, 3, 4],
            ],
        ],
    ],
);
$not Remove by query
var updateById = await g.Sys.Db.RemoveByQuery(new RemoveByQuery("mysql_8", "inventory", "customers")
{
    Find = new JsonObject
    {
        ["customer_id"] = new JsonObject
        {
            ["$not"] = new JsonObject
            {
                ["$in"] = new JsonArray { 1, 2, 3, 4 },
            },
        },
    },
});
$not Remove by query
updateById, err := g.Sys.Db.RemoveByQuery(am.RemoveByQuery{
    Instance: "mysql_8", Database: "inventory", Collection: "customers",
    Find: am.M{
        "customer_id": am.M{
            "$not": am.M{
                "$in": []any{1, 2, 3, 4},
            },
        },
    },
})
if err != nil {
    return nil, err
}
$not Remove by query
let update_by_id = g.sys.db.remove_by_query(
    RemoveByQuery::new("mysql_8", "inventory", "customers")
        .find(json!({
            "customer_id": {
                "$not": {
                    "$in": [1, 2, 3, 4],
                },
            },
        })),
)?;
$not Remove by query
1
2
3
4
5
6
7
8
var updateById = g.sys.db.removeByQuery(new RemoveByQuery("mysql_8", "inventory", "customers")
    .find(Map.of(
        "customer_id", Map.of(
            "$not", Map.of(
                "$in", List.of(1, 2, 3, 4)
            )
        )
    )));
$not Remove by query
val updateById = g.sys.db.removeByQuery(
    RemoveByQuery("mysql_8", "inventory", "customers")
        .find(mapOf(
            "customer_id" to mapOf(
                "\$not" to mapOf(
                    "\$in" to listOf(1, 2, 3, 4),
                ),
            ),
        )),
)

$and removeByQuery

$and Remove by query
let updateById = await g.sys.db.removeByQuery({
    instance: "mysql_8", database: "inventory", collection: "customers",
    find: {
        "$and": [
            {
                "customer_id": 2
            },
            {
                "pincode": 7171
            }
        ]
    }
});
$and Remove by query
update_by_id = await g.sys.db.remove_by_query(
    'mysql_8', 'inventory', 'customers',
    find={
        '$and': [
            {
                'customer_id': 2,
            },
            {
                'pincode': 7171,
            },
        ],
    },
)
$and Remove by query
$updateById = $g->sys->db->removeByQuery(
    'mysql_8', 'inventory', 'customers',
    find: [
        '$and' => [
            [
                'customer_id' => 2,
            ],
            [
                'pincode' => 7171,
            ],
        ],
    ],
);
$and Remove by query
var updateById = await g.Sys.Db.RemoveByQuery(new RemoveByQuery("mysql_8", "inventory", "customers")
{
    Find = new JsonObject
    {
        ["$and"] = new JsonArray
        {
            new JsonObject
            {
                ["customer_id"] = 2,
            },
            new JsonObject
            {
                ["pincode"] = 7171,
            },
        },
    },
});
$and Remove by query
updateById, err := g.Sys.Db.RemoveByQuery(am.RemoveByQuery{
    Instance: "mysql_8", Database: "inventory", Collection: "customers",
    Find: am.M{
        "$and": []any{
            am.M{
                "customer_id": 2,
            },
            am.M{
                "pincode": 7171,
            },
        },
    },
})
if err != nil {
    return nil, err
}
$and Remove by query
let update_by_id = g.sys.db.remove_by_query(
    RemoveByQuery::new("mysql_8", "inventory", "customers")
        .find(json!({
            "$and": [
                {
                    "customer_id": 2,
                },
                {
                    "pincode": 7171,
                },
            ],
        })),
)?;
$and Remove by query
var updateById = g.sys.db.removeByQuery(new RemoveByQuery("mysql_8", "inventory", "customers")
    .find(Map.of(
        "$and", List.of(
            Map.of(
                "customer_id", 2
            ),
            Map.of(
                "pincode", 7171
            )
        )
    )));
$and Remove by query
val updateById = g.sys.db.removeByQuery(
    RemoveByQuery("mysql_8", "inventory", "customers")
        .find(mapOf(
            "\$and" to listOf(
                mapOf(
                    "customer_id" to 2,
                ),
                mapOf(
                    "pincode" to 7171,
                ),
            ),
        )),
)

$or removeByQuery

$or Remove by query
let updateById = await g.sys.db.removeByQuery({
    instance: "mysql_8", database: "inventory", collection: "customers",
    find: {
        "$or": [
            {
                "customer_id": 2
            },
            {
                "pincode": 7171
            }
        ]
    }
});
$or Remove by query
update_by_id = await g.sys.db.remove_by_query(
    'mysql_8', 'inventory', 'customers',
    find={
        '$or': [
            {
                'customer_id': 2,
            },
            {
                'pincode': 7171,
            },
        ],
    },
)
$or Remove by query
$updateById = $g->sys->db->removeByQuery(
    'mysql_8', 'inventory', 'customers',
    find: [
        '$or' => [
            [
                'customer_id' => 2,
            ],
            [
                'pincode' => 7171,
            ],
        ],
    ],
);
$or Remove by query
var updateById = await g.Sys.Db.RemoveByQuery(new RemoveByQuery("mysql_8", "inventory", "customers")
{
    Find = new JsonObject
    {
        ["$or"] = new JsonArray
        {
            new JsonObject
            {
                ["customer_id"] = 2,
            },
            new JsonObject
            {
                ["pincode"] = 7171,
            },
        },
    },
});
$or Remove by query
updateById, err := g.Sys.Db.RemoveByQuery(am.RemoveByQuery{
    Instance: "mysql_8", Database: "inventory", Collection: "customers",
    Find: am.M{
        "$or": []any{
            am.M{
                "customer_id": 2,
            },
            am.M{
                "pincode": 7171,
            },
        },
    },
})
if err != nil {
    return nil, err
}
$or Remove by query
let update_by_id = g.sys.db.remove_by_query(
    RemoveByQuery::new("mysql_8", "inventory", "customers")
        .find(json!({
            "$or": [
                {
                    "customer_id": 2,
                },
                {
                    "pincode": 7171,
                },
            ],
        })),
)?;
$or Remove by query
var updateById = g.sys.db.removeByQuery(new RemoveByQuery("mysql_8", "inventory", "customers")
    .find(Map.of(
        "$or", List.of(
            Map.of(
                "customer_id", 2
            ),
            Map.of(
                "pincode", 7171
            )
        )
    )));
$or Remove by query
val updateById = g.sys.db.removeByQuery(
    RemoveByQuery("mysql_8", "inventory", "customers")
        .find(mapOf(
            "\$or" to listOf(
                mapOf(
                    "customer_id" to 2,
                ),
                mapOf(
                    "pincode" to 7171,
                ),
            ),
        )),
)

$in removeByQuery

$in Remove by query
1
2
3
4
5
6
7
8
let updateById = await g.sys.db.removeByQuery({
    instance: "mysql_8", database: "inventory", collection: "customers",
    find: {
        "customer_id": {
            "$in": [1, 2]
        }
    }
});
$in Remove by query
1
2
3
4
5
6
7
8
update_by_id = await g.sys.db.remove_by_query(
    'mysql_8', 'inventory', 'customers',
    find={
        'customer_id': {
            '$in': [1, 2],
        },
    },
)
$in Remove by query
1
2
3
4
5
6
7
8
$updateById = $g->sys->db->removeByQuery(
    'mysql_8', 'inventory', 'customers',
    find: [
        'customer_id' => [
            '$in' => [1, 2],
        ],
    ],
);
$in Remove by query
var updateById = await g.Sys.Db.RemoveByQuery(new RemoveByQuery("mysql_8", "inventory", "customers")
{
    Find = new JsonObject
    {
        ["customer_id"] = new JsonObject
        {
            ["$in"] = new JsonArray { 1, 2 },
        },
    },
});
$in Remove by query
updateById, err := g.Sys.Db.RemoveByQuery(am.RemoveByQuery{
    Instance: "mysql_8", Database: "inventory", Collection: "customers",
    Find: am.M{
        "customer_id": am.M{
            "$in": []any{1, 2},
        },
    },
})
if err != nil {
    return nil, err
}
$in Remove by query
1
2
3
4
5
6
7
8
let update_by_id = g.sys.db.remove_by_query(
    RemoveByQuery::new("mysql_8", "inventory", "customers")
        .find(json!({
            "customer_id": {
                "$in": [1, 2],
            },
        })),
)?;
$in Remove by query
1
2
3
4
5
6
var updateById = g.sys.db.removeByQuery(new RemoveByQuery("mysql_8", "inventory", "customers")
    .find(Map.of(
        "customer_id", Map.of(
            "$in", List.of(1, 2)
        )
    )));
$in Remove by query
1
2
3
4
5
6
7
8
val updateById = g.sys.db.removeByQuery(
    RemoveByQuery("mysql_8", "inventory", "customers")
        .find(mapOf(
            "customer_id" to mapOf(
                "\$in" to listOf(1, 2),
            ),
        )),
)

$nin removeByQuery

$nin Remove by query
1
2
3
4
5
6
7
8
let updateById = await g.sys.db.removeByQuery({
    instance: "mysql_8", database: "inventory", collection: "customers",
    find: {
        "customer_id": {
            "$nin": [1, 2]
        }
    }
});
$nin Remove by query
1
2
3
4
5
6
7
8
update_by_id = await g.sys.db.remove_by_query(
    'mysql_8', 'inventory', 'customers',
    find={
        'customer_id': {
            '$nin': [1, 2],
        },
    },
)
$nin Remove by query
1
2
3
4
5
6
7
8
$updateById = $g->sys->db->removeByQuery(
    'mysql_8', 'inventory', 'customers',
    find: [
        'customer_id' => [
            '$nin' => [1, 2],
        ],
    ],
);
$nin Remove by query
var updateById = await g.Sys.Db.RemoveByQuery(new RemoveByQuery("mysql_8", "inventory", "customers")
{
    Find = new JsonObject
    {
        ["customer_id"] = new JsonObject
        {
            ["$nin"] = new JsonArray { 1, 2 },
        },
    },
});
$nin Remove by query
updateById, err := g.Sys.Db.RemoveByQuery(am.RemoveByQuery{
    Instance: "mysql_8", Database: "inventory", Collection: "customers",
    Find: am.M{
        "customer_id": am.M{
            "$nin": []any{1, 2},
        },
    },
})
if err != nil {
    return nil, err
}
$nin Remove by query
1
2
3
4
5
6
7
8
let update_by_id = g.sys.db.remove_by_query(
    RemoveByQuery::new("mysql_8", "inventory", "customers")
        .find(json!({
            "customer_id": {
                "$nin": [1, 2],
            },
        })),
)?;
$nin Remove by query
1
2
3
4
5
6
var updateById = g.sys.db.removeByQuery(new RemoveByQuery("mysql_8", "inventory", "customers")
    .find(Map.of(
        "customer_id", Map.of(
            "$nin", List.of(1, 2)
        )
    )));
$nin Remove by query
1
2
3
4
5
6
7
8
val updateById = g.sys.db.removeByQuery(
    RemoveByQuery("mysql_8", "inventory", "customers")
        .find(mapOf(
            "customer_id" to mapOf(
                "\$nin" to listOf(1, 2),
            ),
        )),
)

$like removeByQuery

$nin Remove by query
1
2
3
4
5
6
7
8
let updateById = await g.sys.db.removeByQuery({
    instance: "mysql_8", database: "inventory", collection: "customers",
    find: {
        "first_name": {
            "$like": "Bob%"
        }
    }
});
$nin Remove by query
1
2
3
4
5
6
7
8
update_by_id = await g.sys.db.remove_by_query(
    'mysql_8', 'inventory', 'customers',
    find={
        'first_name': {
            '$like': 'Bob%',
        },
    },
)
$nin Remove by query
1
2
3
4
5
6
7
8
$updateById = $g->sys->db->removeByQuery(
    'mysql_8', 'inventory', 'customers',
    find: [
        'first_name' => [
            '$like' => 'Bob%',
        ],
    ],
);
$nin Remove by query
var updateById = await g.Sys.Db.RemoveByQuery(new RemoveByQuery("mysql_8", "inventory", "customers")
{
    Find = new JsonObject
    {
        ["first_name"] = new JsonObject
        {
            ["$like"] = "Bob%",
        },
    },
});
$nin Remove by query
updateById, err := g.Sys.Db.RemoveByQuery(am.RemoveByQuery{
    Instance: "mysql_8", Database: "inventory", Collection: "customers",
    Find: am.M{
        "first_name": am.M{
            "$like": "Bob%",
        },
    },
})
if err != nil {
    return nil, err
}
$nin Remove by query
1
2
3
4
5
6
7
8
let update_by_id = g.sys.db.remove_by_query(
    RemoveByQuery::new("mysql_8", "inventory", "customers")
        .find(json!({
            "first_name": {
                "$like": "Bob%",
            },
        })),
)?;
$nin Remove by query
1
2
3
4
5
6
var updateById = g.sys.db.removeByQuery(new RemoveByQuery("mysql_8", "inventory", "customers")
    .find(Map.of(
        "first_name", Map.of(
            "$like", "Bob%"
        )
    )));
$nin Remove by query
1
2
3
4
5
6
7
8
val updateById = g.sys.db.removeByQuery(
    RemoveByQuery("mysql_8", "inventory", "customers")
        .find(mapOf(
            "first_name" to mapOf(
                "\$like" to "Bob%",
            ),
        )),
)

MongoDB $in operator in nested find

$in operator in nested find
let updateById = await g.sys.db.removeByQuery({
    instance: "mysql_8", database: "inventory", collection: "customers",
    find: {
        "eventListeners.versions.name": {
            "$in": [
                "Original",
                "1"
            ]
        }
    }
});
$in operator in nested find
update_by_id = await g.sys.db.remove_by_query(
    'mysql_8', 'inventory', 'customers',
    find={
        'eventListeners.versions.name': {
            '$in': [
                'Original',
                '1',
            ],
        },
    },
)
$in operator in nested find
$updateById = $g->sys->db->removeByQuery(
    'mysql_8', 'inventory', 'customers',
    find: [
        'eventListeners.versions.name' => [
            '$in' => [
                'Original',
                '1',
            ],
        ],
    ],
);
$in operator in nested find
var updateById = await g.Sys.Db.RemoveByQuery(new RemoveByQuery("mysql_8", "inventory", "customers")
{
    Find = new JsonObject
    {
        ["eventListeners.versions.name"] = new JsonObject
        {
            ["$in"] = new JsonArray
            {
                "Original",
                "1",
            },
        },
    },
});
$in operator in nested find
updateById, err := g.Sys.Db.RemoveByQuery(am.RemoveByQuery{
    Instance: "mysql_8", Database: "inventory", Collection: "customers",
    Find: am.M{
        "eventListeners.versions.name": am.M{
            "$in": []string{
                "Original",
                "1",
            },
        },
    },
})
if err != nil {
    return nil, err
}
$in operator in nested find
let update_by_id = g.sys.db.remove_by_query(
    RemoveByQuery::new("mysql_8", "inventory", "customers")
        .find(json!({
            "eventListeners.versions.name": {
                "$in": [
                    "Original",
                    "1",
                ],
            },
        })),
)?;
$in operator in nested find
1
2
3
4
5
6
7
8
9
var updateById = g.sys.db.removeByQuery(new RemoveByQuery("mysql_8", "inventory", "customers")
    .find(Map.of(
        "eventListeners.versions.name", Map.of(
            "$in", List.of(
                "Original",
                "1"
            )
        )
    )));
$in operator in nested find
val updateById = g.sys.db.removeByQuery(
    RemoveByQuery("mysql_8", "inventory", "customers")
        .find(mapOf(
            "eventListeners.versions.name" to mapOf(
                "\$in" to listOf(
                    "Original",
                    "1",
                ),
            ),
        )),
)

MongoDB $nin operator in nested find

$nin operator in nested find
let updateById = await g.sys.db.removeByQuery({
    instance: "mysql_8", database: "inventory", collection: "customers",
    find: {
        "eventListeners.versions.name": {
            "$nin": [
                "Original",
                "1"
            ]
        }
    }
});
$nin operator in nested find
update_by_id = await g.sys.db.remove_by_query(
    'mysql_8', 'inventory', 'customers',
    find={
        'eventListeners.versions.name': {
            '$nin': [
                'Original',
                '1',
            ],
        },
    },
)
$nin operator in nested find
$updateById = $g->sys->db->removeByQuery(
    'mysql_8', 'inventory', 'customers',
    find: [
        'eventListeners.versions.name' => [
            '$nin' => [
                'Original',
                '1',
            ],
        ],
    ],
);
$nin operator in nested find
var updateById = await g.Sys.Db.RemoveByQuery(new RemoveByQuery("mysql_8", "inventory", "customers")
{
    Find = new JsonObject
    {
        ["eventListeners.versions.name"] = new JsonObject
        {
            ["$nin"] = new JsonArray
            {
                "Original",
                "1",
            },
        },
    },
});
$nin operator in nested find
updateById, err := g.Sys.Db.RemoveByQuery(am.RemoveByQuery{
    Instance: "mysql_8", Database: "inventory", Collection: "customers",
    Find: am.M{
        "eventListeners.versions.name": am.M{
            "$nin": []string{
                "Original",
                "1",
            },
        },
    },
})
if err != nil {
    return nil, err
}
$nin operator in nested find
let update_by_id = g.sys.db.remove_by_query(
    RemoveByQuery::new("mysql_8", "inventory", "customers")
        .find(json!({
            "eventListeners.versions.name": {
                "$nin": [
                    "Original",
                    "1",
                ],
            },
        })),
)?;
$nin operator in nested find
1
2
3
4
5
6
7
8
9
var updateById = g.sys.db.removeByQuery(new RemoveByQuery("mysql_8", "inventory", "customers")
    .find(Map.of(
        "eventListeners.versions.name", Map.of(
            "$nin", List.of(
                "Original",
                "1"
            )
        )
    )));
$nin operator in nested find
val updateById = g.sys.db.removeByQuery(
    RemoveByQuery("mysql_8", "inventory", "customers")
        .find(mapOf(
            "eventListeners.versions.name" to mapOf(
                "\$nin" to listOf(
                    "Original",
                    "1",
                ),
            ),
        )),
)

MongoDB $and operator in nested find

$and operator in nested find
let updateById = await g.sys.db.removeByQuery({
    instance: "mysql_8", database: "inventory", collection: "customers",
    find: {
        "$and": [
            {
                "eventListeners.versions.name": "Original"
            },
            {
                "eventListeners.versions.version": "-1"
            }
        ]
    }
});
$and operator in nested find
update_by_id = await g.sys.db.remove_by_query(
    'mysql_8', 'inventory', 'customers',
    find={
        '$and': [
            {
                'eventListeners.versions.name': 'Original',
            },
            {
                'eventListeners.versions.version': '-1',
            },
        ],
    },
)
$and operator in nested find
$updateById = $g->sys->db->removeByQuery(
    'mysql_8', 'inventory', 'customers',
    find: [
        '$and' => [
            [
                'eventListeners.versions.name' => 'Original',
            ],
            [
                'eventListeners.versions.version' => '-1',
            ],
        ],
    ],
);
$and operator in nested find
var updateById = await g.Sys.Db.RemoveByQuery(new RemoveByQuery("mysql_8", "inventory", "customers")
{
    Find = new JsonObject
    {
        ["$and"] = new JsonArray
        {
            new JsonObject
            {
                ["eventListeners.versions.name"] = "Original",
            },
            new JsonObject
            {
                ["eventListeners.versions.version"] = "-1",
            },
        },
    },
});
$and operator in nested find
updateById, err := g.Sys.Db.RemoveByQuery(am.RemoveByQuery{
    Instance: "mysql_8", Database: "inventory", Collection: "customers",
    Find: am.M{
        "$and": []any{
            am.M{
                "eventListeners.versions.name": "Original",
            },
            am.M{
                "eventListeners.versions.version": "-1",
            },
        },
    },
})
if err != nil {
    return nil, err
}
$and operator in nested find
let update_by_id = g.sys.db.remove_by_query(
    RemoveByQuery::new("mysql_8", "inventory", "customers")
        .find(json!({
            "$and": [
                {
                    "eventListeners.versions.name": "Original",
                },
                {
                    "eventListeners.versions.version": "-1",
                },
            ],
        })),
)?;
$and operator in nested find
var updateById = g.sys.db.removeByQuery(new RemoveByQuery("mysql_8", "inventory", "customers")
    .find(Map.of(
        "$and", List.of(
            Map.of(
                "eventListeners.versions.name", "Original"
            ),
            Map.of(
                "eventListeners.versions.version", "-1"
            )
        )
    )));
$and operator in nested find
val updateById = g.sys.db.removeByQuery(
    RemoveByQuery("mysql_8", "inventory", "customers")
        .find(mapOf(
            "\$and" to listOf(
                mapOf(
                    "eventListeners.versions.name" to "Original",
                ),
                mapOf(
                    "eventListeners.versions.version" to "-1",
                ),
            ),
        )),
)

MongoDB $or operator in nested find

$or operator in nested find
let updateById = await g.sys.db.removeByQuery({
    instance: "mysql_8", database: "inventory", collection: "customers",
    find: {
        "$or": [
            {
                "eventListeners.versions.name": "Original"
            },
            {
                "eventListeners.versions.version": "-1"
            }
        ]
    }
});
$or operator in nested find
update_by_id = await g.sys.db.remove_by_query(
    'mysql_8', 'inventory', 'customers',
    find={
        '$or': [
            {
                'eventListeners.versions.name': 'Original',
            },
            {
                'eventListeners.versions.version': '-1',
            },
        ],
    },
)
$or operator in nested find
$updateById = $g->sys->db->removeByQuery(
    'mysql_8', 'inventory', 'customers',
    find: [
        '$or' => [
            [
                'eventListeners.versions.name' => 'Original',
            ],
            [
                'eventListeners.versions.version' => '-1',
            ],
        ],
    ],
);
$or operator in nested find
var updateById = await g.Sys.Db.RemoveByQuery(new RemoveByQuery("mysql_8", "inventory", "customers")
{
    Find = new JsonObject
    {
        ["$or"] = new JsonArray
        {
            new JsonObject
            {
                ["eventListeners.versions.name"] = "Original",
            },
            new JsonObject
            {
                ["eventListeners.versions.version"] = "-1",
            },
        },
    },
});
$or operator in nested find
updateById, err := g.Sys.Db.RemoveByQuery(am.RemoveByQuery{
    Instance: "mysql_8", Database: "inventory", Collection: "customers",
    Find: am.M{
        "$or": []any{
            am.M{
                "eventListeners.versions.name": "Original",
            },
            am.M{
                "eventListeners.versions.version": "-1",
            },
        },
    },
})
if err != nil {
    return nil, err
}
$or operator in nested find
let update_by_id = g.sys.db.remove_by_query(
    RemoveByQuery::new("mysql_8", "inventory", "customers")
        .find(json!({
            "$or": [
                {
                    "eventListeners.versions.name": "Original",
                },
                {
                    "eventListeners.versions.version": "-1",
                },
            ],
        })),
)?;
$or operator in nested find
var updateById = g.sys.db.removeByQuery(new RemoveByQuery("mysql_8", "inventory", "customers")
    .find(Map.of(
        "$or", List.of(
            Map.of(
                "eventListeners.versions.name", "Original"
            ),
            Map.of(
                "eventListeners.versions.version", "-1"
            )
        )
    )));
$or operator in nested find
val updateById = g.sys.db.removeByQuery(
    RemoveByQuery("mysql_8", "inventory", "customers")
        .find(mapOf(
            "\$or" to listOf(
                mapOf(
                    "eventListeners.versions.name" to "Original",
                ),
                mapOf(
                    "eventListeners.versions.version" to "-1",
                ),
            ),
        )),
)

Structure

Remove by query
let updateById = await g.sys.db.removeByQuery({
    instance: "INSTANCE_NAME", database: 'DB_NAME', collection: "COLLECTION_NAME",
    find: {
        "COLUMN_NAME": "VALUE"
    },
    headers: {
        "x-am-response-case": "capitalCase", // noChange | camelCase | capitalCase | constantCase | dotCase | headerCase | noCase | paramCase | pascalCase | pathCase | sentenceCase | snakeCase
        "x-am-response-object-type": "make_flat", // no_action | make_flat
        "x-am-meta": "true", // true, false
        "x-am-internationalization": "USER_I18N_ID",
        "x-am-run-in-sandbox": "2",
        "x-am-content-type-response": "text/xml", // application/json | text/xml | text/yaml | text/plain | text/html | application/octet-stream
        "x-am-cache-control": "reset_cache", // no_action | reset_cache
        "x-am-get-encrypted-data": "get_only_encryption", // no_encryption | get_only_encryption | get_data_and_encryption
        "x-am-sandbox-timeout": "13000",
        "x-no-compression": "true", // true | false
        "x-am-encrypted-payload": "true", // user will send 'true', when payload is encrypted for transfer
        // Multi-tenant : the tenant of the request, each instance finds it in its own tenants table
        "x-am-tenant-username": "TENANT_USERNAME", // ex: acme
        // Authorization headers
        "x-am-authorization": "AUTHORIZATION_TOKEN",
        "x-am-user-authorization": "API_USER_TOKEN",
        "x-aws-authorization": "AWS_TOKEN",
        "x-google-authorization": "GOOGLE_TOKEN",
        "x-azure-authorization": "AZURE_TOKEN",
    },
});
Remove by query
update_by_id = await g.sys.db.remove_by_query(
    'INSTANCE_NAME', 'DB_NAME', 'COLLECTION_NAME',
    find={
        'COLUMN_NAME': 'VALUE',
    },
    headers={
        'x-am-response-case': 'capitalCase',  # noChange | camelCase | capitalCase | constantCase | dotCase | headerCase | noCase | paramCase | pascalCase | pathCase | sentenceCase | snakeCase
        'x-am-response-object-type': 'make_flat',  # no_action | make_flat
        'x-am-meta': 'true',  # true, false
        'x-am-internationalization': 'USER_I18N_ID',
        'x-am-run-in-sandbox': '2',
        'x-am-content-type-response': 'text/xml',  # application/json | text/xml | text/yaml | text/plain | text/html | application/octet-stream
        'x-am-cache-control': 'reset_cache',  # no_action | reset_cache
        'x-am-get-encrypted-data': 'get_only_encryption',  # no_encryption | get_only_encryption | get_data_and_encryption
        'x-am-sandbox-timeout': '13000',
        'x-no-compression': 'true',  # true | false
        'x-am-encrypted-payload': 'true',  # user will send 'true', when payload is encrypted for transfer
        # Multi-tenant : the tenant of the request, each instance finds it in its own tenants table
        'x-am-tenant-username': 'TENANT_USERNAME',  # ex: acme
        # Authorization headers
        'x-am-authorization': 'AUTHORIZATION_TOKEN',
        'x-am-user-authorization': 'API_USER_TOKEN',
        'x-aws-authorization': 'AWS_TOKEN',
        'x-google-authorization': 'GOOGLE_TOKEN',
        'x-azure-authorization': 'AZURE_TOKEN',
    },
)
Remove by query
$updateById = $g->sys->db->removeByQuery(
    'INSTANCE_NAME', 'DB_NAME', 'COLLECTION_NAME',
    find: [
        'COLUMN_NAME' => 'VALUE',
    ],
    headers: [
        'x-am-response-case' => 'capitalCase', // noChange | camelCase | capitalCase | constantCase | dotCase | headerCase | noCase | paramCase | pascalCase | pathCase | sentenceCase | snakeCase
        'x-am-response-object-type' => 'make_flat', // no_action | make_flat
        'x-am-meta' => 'true', // true, false
        'x-am-internationalization' => 'USER_I18N_ID',
        'x-am-run-in-sandbox' => '2',
        'x-am-content-type-response' => 'text/xml', // application/json | text/xml | text/yaml | text/plain | text/html | application/octet-stream
        'x-am-cache-control' => 'reset_cache', // no_action | reset_cache
        'x-am-get-encrypted-data' => 'get_only_encryption', // no_encryption | get_only_encryption | get_data_and_encryption
        'x-am-sandbox-timeout' => '13000',
        'x-no-compression' => 'true', // true | false
        'x-am-encrypted-payload' => 'true', // user will send 'true', when payload is encrypted for transfer
        // Multi-tenant : the tenant of the request, each instance finds it in its own tenants table
        'x-am-tenant-username' => 'TENANT_USERNAME', // ex: acme
        // Authorization headers
        'x-am-authorization' => 'AUTHORIZATION_TOKEN',
        'x-am-user-authorization' => 'API_USER_TOKEN',
        'x-aws-authorization' => 'AWS_TOKEN',
        'x-google-authorization' => 'GOOGLE_TOKEN',
        'x-azure-authorization' => 'AZURE_TOKEN',
    ],
);
Remove by query
var updateById = await g.Sys.Db.RemoveByQuery(new RemoveByQuery("INSTANCE_NAME", "DB_NAME", "COLLECTION_NAME")
{
    Find = new JsonObject
    {
        ["COLUMN_NAME"] = "VALUE",
    },
    Headers = new JsonObject
    {
        ["x-am-response-case"] = "capitalCase", // noChange | camelCase | capitalCase | constantCase | dotCase | headerCase | noCase | paramCase | pascalCase | pathCase | sentenceCase | snakeCase
        ["x-am-response-object-type"] = "make_flat", // no_action | make_flat
        ["x-am-meta"] = "true", // true, false
        ["x-am-internationalization"] = "USER_I18N_ID",
        ["x-am-run-in-sandbox"] = "2",
        ["x-am-content-type-response"] = "text/xml", // application/json | text/xml | text/yaml | text/plain | text/html | application/octet-stream
        ["x-am-cache-control"] = "reset_cache", // no_action | reset_cache
        ["x-am-get-encrypted-data"] = "get_only_encryption", // no_encryption | get_only_encryption | get_data_and_encryption
        ["x-am-sandbox-timeout"] = "13000",
        ["x-no-compression"] = "true", // true | false
        ["x-am-encrypted-payload"] = "true", // user will send 'true', when payload is encrypted for transfer
        // Multi-tenant : the tenant of the request, each instance finds it in its own tenants table
        ["x-am-tenant-username"] = "TENANT_USERNAME", // ex: acme
        // Authorization headers
        ["x-am-authorization"] = "AUTHORIZATION_TOKEN",
        ["x-am-user-authorization"] = "API_USER_TOKEN",
        ["x-aws-authorization"] = "AWS_TOKEN",
        ["x-google-authorization"] = "GOOGLE_TOKEN",
        ["x-azure-authorization"] = "AZURE_TOKEN",
    },
});
Remove by query
updateById, err := g.Sys.Db.RemoveByQuery(am.RemoveByQuery{
    Instance: "INSTANCE_NAME", Database: "DB_NAME", Collection: "COLLECTION_NAME",
    Find: am.M{
        "COLUMN_NAME": "VALUE",
    },
    Headers: am.M{
        "x-am-response-case":         "capitalCase", // noChange | camelCase | capitalCase | constantCase | dotCase | headerCase | noCase | paramCase | pascalCase | pathCase | sentenceCase | snakeCase
        "x-am-response-object-type":  "make_flat",   // no_action | make_flat
        "x-am-meta":                  "true",        // true, false
        "x-am-internationalization":  "USER_I18N_ID",
        "x-am-run-in-sandbox":        "2",
        "x-am-content-type-response": "text/xml",            // application/json | text/xml | text/yaml | text/plain | text/html | application/octet-stream
        "x-am-cache-control":         "reset_cache",         // no_action | reset_cache
        "x-am-get-encrypted-data":    "get_only_encryption", // no_encryption | get_only_encryption | get_data_and_encryption
        "x-am-sandbox-timeout":       "13000",
        "x-no-compression":           "true", // true | false
        "x-am-encrypted-payload":     "true", // user will send 'true', when payload is encrypted for transfer
        // Multi-tenant : the tenant of the request, each instance finds it in its own tenants table
        "x-am-tenant-username": "TENANT_USERNAME", // ex: acme
        // Authorization headers
        "x-am-authorization":      "AUTHORIZATION_TOKEN",
        "x-am-user-authorization": "API_USER_TOKEN",
        "x-aws-authorization":     "AWS_TOKEN",
        "x-google-authorization":  "GOOGLE_TOKEN",
        "x-azure-authorization":   "AZURE_TOKEN",
    },
})
if err != nil {
    return nil, err
}
Remove by query
let update_by_id = g.sys.db.remove_by_query(
    RemoveByQuery::new("INSTANCE_NAME", "DB_NAME", "COLLECTION_NAME")
        .find(json!({
            "COLUMN_NAME": "VALUE",
        }))
        .headers(json!({
            "x-am-response-case": "capitalCase", // noChange | camelCase | capitalCase | constantCase | dotCase | headerCase | noCase | paramCase | pascalCase | pathCase | sentenceCase | snakeCase
            "x-am-response-object-type": "make_flat", // no_action | make_flat
            "x-am-meta": "true", // true, false
            "x-am-internationalization": "USER_I18N_ID",
            "x-am-run-in-sandbox": "2",
            "x-am-content-type-response": "text/xml", // application/json | text/xml | text/yaml | text/plain | text/html | application/octet-stream
            "x-am-cache-control": "reset_cache", // no_action | reset_cache
            "x-am-get-encrypted-data": "get_only_encryption", // no_encryption | get_only_encryption | get_data_and_encryption
            "x-am-sandbox-timeout": "13000",
            "x-no-compression": "true", // true | false
            "x-am-encrypted-payload": "true", // user will send 'true', when payload is encrypted for transfer
            // Multi-tenant : the tenant of the request, each instance finds it in its own tenants table
            "x-am-tenant-username": "TENANT_USERNAME", // ex: acme
            // Authorization headers
            "x-am-authorization": "AUTHORIZATION_TOKEN",
            "x-am-user-authorization": "API_USER_TOKEN",
            "x-aws-authorization": "AWS_TOKEN",
            "x-google-authorization": "GOOGLE_TOKEN",
            "x-azure-authorization": "AZURE_TOKEN",
        })),
)?;
Remove by query
var updateById = g.sys.db.removeByQuery(new RemoveByQuery("INSTANCE_NAME", "DB_NAME", "COLLECTION_NAME")
    .find(Map.of(
        "COLUMN_NAME", "VALUE"
    ))
    .headers(JsonObject.of(
        "x-am-response-case", "capitalCase", // noChange | camelCase | capitalCase | constantCase | dotCase | headerCase | noCase | paramCase | pascalCase | pathCase | sentenceCase | snakeCase
        "x-am-response-object-type", "make_flat", // no_action | make_flat
        "x-am-meta", "true", // true, false
        "x-am-internationalization", "USER_I18N_ID",
        "x-am-run-in-sandbox", "2",
        "x-am-content-type-response", "text/xml", // application/json | text/xml | text/yaml | text/plain | text/html | application/octet-stream
        "x-am-cache-control", "reset_cache", // no_action | reset_cache
        "x-am-get-encrypted-data", "get_only_encryption", // no_encryption | get_only_encryption | get_data_and_encryption
        "x-am-sandbox-timeout", "13000",
        "x-no-compression", "true", // true | false
        "x-am-encrypted-payload", "true", // user will send 'true', when payload is encrypted for transfer
        // Multi-tenant : the tenant of the request, each instance finds it in its own tenants table
        "x-am-tenant-username", "TENANT_USERNAME", // ex: acme
        // Authorization headers
        "x-am-authorization", "AUTHORIZATION_TOKEN",
        "x-am-user-authorization", "API_USER_TOKEN",
        "x-aws-authorization", "AWS_TOKEN",
        "x-google-authorization", "GOOGLE_TOKEN",
        "x-azure-authorization", "AZURE_TOKEN"
    )));
Remove by query
val updateById = g.sys.db.removeByQuery(
    RemoveByQuery("INSTANCE_NAME", "DB_NAME", "COLLECTION_NAME")
        .find(mapOf(
            "COLUMN_NAME" to "VALUE",
        ))
        .headers(mapOf(
            "x-am-response-case" to "capitalCase", // noChange | camelCase | capitalCase | constantCase | dotCase | headerCase | noCase | paramCase | pascalCase | pathCase | sentenceCase | snakeCase
            "x-am-response-object-type" to "make_flat", // no_action | make_flat
            "x-am-meta" to "true", // true, false
            "x-am-internationalization" to "USER_I18N_ID",
            "x-am-run-in-sandbox" to "2",
            "x-am-content-type-response" to "text/xml", // application/json | text/xml | text/yaml | text/plain | text/html | application/octet-stream
            "x-am-cache-control" to "reset_cache", // no_action | reset_cache
            "x-am-get-encrypted-data" to "get_only_encryption", // no_encryption | get_only_encryption | get_data_and_encryption
            "x-am-sandbox-timeout" to "13000",
            "x-no-compression" to "true", // true | false
            "x-am-encrypted-payload" to "true", // user will send 'true', when payload is encrypted for transfer
            // Multi-tenant : the tenant of the request, each instance finds it in its own tenants table
            "x-am-tenant-username" to "TENANT_USERNAME", // ex: acme
            // Authorization headers
            "x-am-authorization" to "AUTHORIZATION_TOKEN",
            "x-am-user-authorization" to "API_USER_TOKEN",
            "x-aws-authorization" to "AWS_TOKEN",
            "x-google-authorization" to "GOOGLE_TOKEN",
            "x-azure-authorization" to "AZURE_TOKEN",
        )),
)

Multi-tenant

  • instance: "crm::acme" works on the database of the tenant acme of the multi-tenant instance crm.
  • With instance: "crm", the call works on the database of the tenant of the request: a custom API called with the x-am-tenant-username header passes it on to the APIs it calls. A request without a tenant works on the structure database.
Remove customers of the tenant acme by query
1
2
3
4
5
6
let removeByQuery = await g.sys.db.removeByQuery({
    instance: "crm::acme", database: "crm", collection: "customers",
    find: {
        "first_name": "Bob"
    }
});
Remove customers of the tenant acme by query
1
2
3
4
5
6
remove_by_query = await g.sys.db.remove_by_query(
    'crm::acme', 'crm', 'customers',
    find={
        'first_name': 'Bob',
    },
)
Remove customers of the tenant acme by query
1
2
3
4
5
6
$removeByQuery = $g->sys->db->removeByQuery(
    'crm::acme', 'crm', 'customers',
    find: [
        'first_name' => 'Bob',
    ],
);
Remove customers of the tenant acme by query
1
2
3
4
5
6
7
var removeByQuery = await g.Sys.Db.RemoveByQuery(new RemoveByQuery("crm::acme", "crm", "customers")
{
    Find = new JsonObject
    {
        ["first_name"] = "Bob",
    },
});
Remove customers of the tenant acme by query
1
2
3
4
5
6
7
8
9
removeByQuery, err := g.Sys.Db.RemoveByQuery(am.RemoveByQuery{
    Instance: "crm::acme", Database: "crm", Collection: "customers",
    Find: am.M{
        "first_name": "Bob",
    },
})
if err != nil {
    return nil, err
}
Remove customers of the tenant acme by query
1
2
3
4
5
6
let remove_by_query = g.sys.db.remove_by_query(
    RemoveByQuery::new("crm::acme", "crm", "customers")
        .find(json!({
            "first_name": "Bob",
        })),
)?;
Remove customers of the tenant acme by query
1
2
3
4
var removeByQuery = g.sys.db.removeByQuery(new RemoveByQuery("crm::acme", "crm", "customers")
    .find(Map.of(
        "first_name", "Bob"
    )));
Remove customers of the tenant acme by query
1
2
3
4
5
6
val removeByQuery = g.sys.db.removeByQuery(
    RemoveByQuery("crm::acme", "crm", "customers")
        .find(mapOf(
            "first_name" to "Bob",
        )),
)

Without a schema

g.sys.db.gen.removeByQueryGen takes the same arguments and calls the remove by query generated API : no schema, so the data is read and written as it is in the table, without the conversions, validations and defaults of the schema.

Language The call
TypeScript g.sys.db.gen.removeByQueryGen(…)
Python g.sys.db.gen.remove_by_query_gen(…)
PHP $g->sys->db->gen->removeByQueryGen(…)
C#, Go g.Sys.Db.Gen.RemoveByQueryGen(…)
Rust g.sys.db.remove_by_query_gen(RemoveByQuery::new(…))
Java, Kotlin g.sys.db.gen.removeByQueryGen(…)