Creates a :class:`.Spec` that returns the number of elements in the array referenced by the path. Args: path (str): The path to the field. xattr (bool, optional): Whether this operation should reference the document body or the extended attributes data for the docume
(path, # type: str
xattr=False # type: Optional[bool]
)
| 363 | |
| 364 | |
| 365 | def count(path, # type: str |
| 366 | xattr=False # type: Optional[bool] |
| 367 | ) -> Spec: |
| 368 | """Creates a :class:`.Spec` that returns the number of elements in the array referenced by the path. |
| 369 | |
| 370 | Args: |
| 371 | path (str): The path to the field. |
| 372 | xattr (bool, optional): Whether this operation should reference the document body or the |
| 373 | extended attributes data for the document. |
| 374 | |
| 375 | Returns: |
| 376 | :class:`.Spec`: An instance of :class:`.Spec`. |
| 377 | |
| 378 | """ |
| 379 | return Spec(SubDocOp.GET_COUNT, path, xattr) |
| 380 | |
| 381 | |
| 382 | def insert(path, # type: str |