Class LookupInSpec

  • Direct Known Subclasses:

    public abstract class LookupInSpec
    extends Object
    Defines specs to lookup parts in a JSON document.

    Operations allow specifying an empty path ("") which means that the root document level is used (so it will be applied to the full document). By nature it makes sense to only use such a command in isolation, but it can be combined with xattr (extended attributes, a document metadata section) operations as well.

    • Constructor Detail

      • LookupInSpec

        public LookupInSpec()
    • Method Detail

      • export

        public abstract SubdocGetRequest.Command export​(int originalIndex)
        Internal operation called from the encoding side that encodes the spec into its internal representation.
        originalIndex - the original index of the command.
        the encoded command.
      • get

        public static LookupInSpecStandard get​(String path)
        Fetches the content from a field (if present) at the given path.
        path - the path identifying where to get the value.
        the created LookupInSpec.
      • exists

        public static LookupInSpecStandard exists​(String path)
        Checks if a value at the given path exists in the document.
        path - the path to check if the field exists.
        the created LookupInSpec.
      • count

        public static LookupInSpecStandard count​(String path)
        Counts the number of values at a given path in the document.
        path - the path identifying where to count the values.
        the created LookupInSpec.