Creates a :class:`.Spec` for retrieving an element's value given a 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 document. Returns:
(path, # type: str
xattr=False # type: Optional[bool]
)
| 346 | |
| 347 | |
| 348 | def get(path, # type: str |
| 349 | xattr=False # type: Optional[bool] |
| 350 | ) -> Spec: |
| 351 | """Creates a :class:`.Spec` for retrieving an element's value given a path. |
| 352 | |
| 353 | Args: |
| 354 | path (str): The path to the field. |
| 355 | xattr (bool, optional): Whether this operation should reference the document body or the |
| 356 | extended attributes data for the document. |
| 357 | |
| 358 | Returns: |
| 359 | :class:`.Spec`: An instance of :class:`.Spec`. |
| 360 | |
| 361 | """ |
| 362 | return Spec(SubDocOp.GET, path, xattr) |
| 363 | |
| 364 | |
| 365 | def count(path, # type: str |