Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • ReplaceOne

Index

Properties

Properties

$replaceOne: { input: StringExpression<string>; find: StringExpression<string>; replacement: StringExpression<string> }

Replaces the first instance of a matched string in a given input.

version

4.4

see

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

Type declaration

  • input: StringExpression<string>

    The string on which you wish to apply the find. Can be any valid expression that resolves to a string or a null. If input refers to a field that is missing, $replaceOne returns null.

  • find: StringExpression<string>

    The string to search for within the given input. Can be any valid expression that resolves to a string or a null. If find refers to a field that is missing, $replaceOne returns null.

  • replacement: StringExpression<string>

    The string to use to replace the first matched instance of find in input. Can be any valid expression that resolves to a string or a null.

Generated using TypeDoc