mongo-dot-notation
Version:
Transform objects to MongoDB update instructions
36 lines (35 loc) • 1.27 kB
TypeScript
/**
* Uses a bitwise _and_ operation to update a field.
* Alias for `$bit().$and()`.
* @see https://www.mongodb.com/docs/manual/reference/operator/update/bit/#bitwise-and
*/
export declare const $and: <T>(value: T) => import("./operator").Operator;
/**
* Uses a bitwise `or` operation to update a field.
* Alias for `$bit().$or()`.
* @see https://www.mongodb.com/docs/manual/reference/operator/update/bit/#bitwise-or
*/
export declare const $or: <T>(value: T) => import("./operator").Operator;
/**
* Uses a bitwise `xor` operation to update a field.
* Alias for `$bit().$xor()`.
* @see https://www.mongodb.com/docs/manual/reference/operator/update/bit/#bitwise-xor
*/
export declare const $xor: <T>(value: T) => import("./operator").Operator;
/**
* Performs a bitwise update of a field.
* Should be chained with a logical operator.
* @see https://docs.mongodb.com/manual/reference/operator/update/#bitwise
*
* @example
* ```ts
* flatten({ permissions: $bit().$and(4) });
* // same as:
* flatten({ permissions: $and(4) })
* ```
*/
export declare const $bit: () => {
$and: <T>(value: T) => import("./operator").Operator;
$or: <T_1>(value: T_1) => import("./operator").Operator;
$xor: <T_2>(value: T_2) => import("./operator").Operator;
};