AYUDA EN LÍNEA
 WINDEVWEBDEV Y WINDEV MOBILE

Este contenido se ha traducido automáticamente.  Haga clic aquí  para ver la versión en inglés.
Ayuda / WLanguage / Administrar bases de datos / Big Data / Gestión de archivos de datos Mongo
WINDEV
WindowsLinuxJavaReportes y ConsultasCódigo de Usuario (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Código Navegador
WINDEV Mobile
AndroidWidget Android iPhone/iPadIOS WidgetApple WatchMac Catalyst
Otros
Procedimientos almacenados
Modifies a document in a collection of MongoDB database.
Ejemplo
let sFiltre = "{ ""name"": ""Andy"" }"
OR sModification = "{ ""$inc"": { ""score"": 1 } }"
let d = MongoModifyOne(Collection, sFilter, sModification)
// Find the first contact whose "FirstName" member is set to "Jack" and modify it to "Joey" 
// Search filter 
sFilter is TO string = "{ ""First name"": ""James"" }"
// Modification criterion
sModification is TO string = "{ ""$set"": { ""Firstname"": ""Jules"" } }"
MongoModifyOne(gclCollection, sFilter, sModification)
Sintaxis
<Result> = MongoModifyOne(<Collection> , <Filter> , <Modification> [, <Sort>] [, <Option>])
<Result>: Variant
Document before or after modification (according to the selected option).
<Collection>: mongoCollection variable
Name of the mongoCollection variable that represents the MongoDB collection in which the modification will be made.
<Filter>: Type of filter used
Description of the MongoDB filter(s) that will be applied to select the document to update. This filter corresponds to:
  • a JSON document, in string format.
  • a BSON document, in buffer format.
  • a variant.
<Modification>: Type of the format used
Description of the modifications that will be performed in the document that matches the filter. Corresponds to:
  • a JSON document, in string format.
  • a BSON document, in buffer format.
  • a variant.
<Sort>: Optional type corresponding to the format used
Sort options used to define the first document that will be modified when several documents correspond to the filter. Corresponds to:
  • a JSON document, in string format.
  • a BSON document, in buffer format.
  • a variant.
<Option>: Optional Integer constant
Editing options:
mongoAddIfNotFoundUsed to add the document if it does not exist in the collection.
mongoReturnValueAfterUsed to return the document after modification.
By default, if this constant is not used, the document returned corresponds to the document before modification.
Componente: wd300big.dll
Versión mínima requerida
  • Versión 22
Esta página también está disponible para…
Comentarios
Haga clic en [Agregar] para publicar un comentario

Última modificación: 27/03/2025

Señalar un error o enviar una sugerencia | Ayuda local