Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • SetField

Index

Properties

Properties

$setField: { field: StringExpression<string>; input?: ObjectExpression; value?: any }

Adds, updates, or removes a specified field in a document.

version

5.0

see

https://docs.mongodb.com/manual/reference/operator/aggregation/setField/#mongodb-expression-exp.-setField

Type declaration

  • field: StringExpression<string>

    Field in the input object that you want to add, update, or remove. field can be any valid expression that resolves to a string constant.

  • Optional input?: ObjectExpression

    Document that contains the field that you want to add or update. input must resolve to an object, missing, null, or undefined

  • Optional value?: any

    The value that you want to assign to field. value can be any valid expression.

Generated using TypeDoc