Only keep entities that are themselves, or have fields that are, pointed to by:
entityOfType: some field of entities of a set of typeslocations: specific locationsentities: some field of specific entitiesPassing an empty list to any of these methods will result in an empty query result.
Use e.g. as:
nexus.entities.pointedToBy.entitiesOfType("tb303").get()
Only keep entities that have some fields that point to:
entityOfType: some field of entities of a set of typeslocations: specific locationsentities: some field of specific entitiesPassing an empty list to any of these methods will result in an empty query result.
Use e.g. like:
nexus.entities.pointingTo.entitiesOfType("tb303").get()
Return the FieldQuery<NexusField> that starts with all fields of all
currently selected entities.
Returns all entities selected by this query, in undefined order.
Of all selected entities, return the one with id id, if it exists.
Get an entity as a specific type, if it exists and has the type matching one of the provided types.
Returns the first entity returned by get(), if any.
Since the order of entities in get() is undefined, which of the selected
entity this method returns is also undefined. This method is intended to be used
if it's known that the query will return at most one entity.
Check if a specific entity is contained in the current query.
Of all selected entities, return the one with id id. Throw if it doesn't
exist.
Get an entity as a specific type, if it has the type matching one of the provided types. Throw if it doesn't exist.
Omit entities whose type string appears in types.
Only keep entities whose messages are marked with a target type appearing
in targetTypes. Target types of fields of entities are ignored.
Only keep entities whose type string appears in types.
Provides facilities to query the nexus document.
Once the query is built, execute it by calling
get().There are two ways to get access to an entity query.
{@link TransactionBuilder.entities}{@link NexusDocument.queryEntitiesWithoutLock}Example usage:
If the results of a query are used to create a transaction, the
entitiesof theTransactionBuildershould be used. Transactions are created asynchronously, so the result of the query can become out of date once the transaction lock is acquired, and transaction errors can occur.Entity queries can technically be "recycled", meaning that you can type:
However, note that queries created this way will throw if they're used outside of a transaction.
To query the document without awaiting the transaction lock, you can use