Function findChildById

  • Retrieve a child item by its _id field and its parent _id.

    Child objects can only be directly retrieved with both the parent and child _id. This limitation allows them to be stored without an extra index, and enables the findChildren method to retrieve all the children of a root object in the same call.

    Type Parameters

    Parameters

    • context: Context

      the context object

    • collectionName: string

      name of the collection to search

    • id: string

      the _id value

    • rootObjectId: string

      the _id of the root object

    • Optional options: {
          consistentRead?: boolean;
      }

      the the set of options for the search

      • Optional consistentRead?: boolean

        search with strongly consistent reads

    Returns Promise<DocumentType | undefined>

    the stored value, or undefined if not found

    Throws

    when the collection is not found in the context

Generated using TypeDoc