/** * @param update this uses the basic Mongoose updateOne * @example * // increase a specific value (here by 15): * { $inc: { popularity: 15 } } * // * @example * // or add element to a list: * { $push: { reactions: this.newReaction } * // or add multiple elements to a list * { $push: { schedule: {$each: [ monday, tuesday, wednesday ] } } } * // * @example * // or all at once * { * $inc: { popularity: this.newVote.amount }, * emailVerified: true, * $push: { reactions: this.newReaction } * } * // further tools (syntax matches with $inc): * $currentDate: // Sets the value of a field to current date, either as a Date or a Timestamp. * $min: // Only updates the field if the specified value is less than the existing field value. * $max: // Only updates the field if the specified value is greater than the existing field value. * $mul: // Multiplies the value of the field by the specified amount. * $rename: // Renames a field. * $unset: // Removes the specified field from a document. (set: "" to value) * // */ export type DyNTS_DBUpdate = { /** * Sets the value of a field to current date, either as a Date or a Timestamp. */ /** * Increments the value of the field by the specified amount. */ $inc?: { [K in keyof T]?: number; }; /** * Only updates the field if the specified value is less than the existing field value. */ $min?: { [K in keyof T]?: number; }; /** * Only updates the field if the specified value is greater than the existing field value. */ $max?: { [K in keyof T]?: number; }; /** * Multiplies the value of the field by the specified amount. */ $mul?: { [K in keyof T]?: number; }; /** * Renames a field. */ $rename?: { [K in keyof T]?: string; }; /** * Removes the specified field from a document. (set: "" to value) */ $unset?: { [K in keyof T]?: string; }; /** * Sets the value of a field in a document. */ $set?: { [K in keyof T]?: string; } | any; /** * Sets the value of a field if an update results in an insert of a document. * Has no effect on update operations that modify existing documents. */ $setOnInsert?: { [K in keyof T]?: T[K]; }; /** * Removes the first or last item of an array. */ /** * Removes the first or last item of an array. */ $push?: { [K in keyof T]?: any | { $each?: T[K]; }; }; /** * Removes the first or last item of an array. */ $addToSet?: { [K in keyof T]?: any | { $each?: T[K]; }; }; /** * Removes the first or last item of an array. */ $pop?: { [K in keyof T]?: 1 | -1; }; /** * Removes all array elements that match a specified query. */ $pull?: { [K in keyof T]?: any | { $each?: T[K]; }; }; /** * Removes all array elements that match a specified query. */ $pullAll?: { [K in keyof T]?: any | { $each?: T[K]; }; }; } & DyNTS_DBSimpleUpdate; /** * */ export type DyNTS_DBSimpleUpdate = { [K in keyof T]?: T[K]; }; //# sourceMappingURL=db-update.type.d.ts.map