Class QueryExtensionsKt

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Field Summary

      Fields 
      Modifier and Type Field Description
    • Constructor Summary

      Constructors 
      Constructor Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      final static <T extends Any> T data(Result $self, String key) Uses Kotlin Serialization to create an object of type T from a query result.
      final static <T extends DocumentModel> T data(Result $self, String key, String metaKey) Uses Kotlin Serialization to create a DocumentModel instance of type T from the query result.
      final static <T extends Any> T data(Result $self, DeserializationStrategy<T> deserializer, String key, String metaKey)
      final static <T extends Any> Sequence<T> data(ResultSet $self, String key) Returns the query rows transformed by Kotlin Serialization into instances of T.
      final static <T extends DocumentModel> Sequence<T> data(ResultSet $self, String key, String metaKey)
      final static <T extends Any> Sequence<T> data(ResultSet $self, DeserializationStrategy<T> deserializer, String key, String metaKey) Returns the query rows transformed by Kotlin Serialization into instances of T.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

    • Method Detail

      • data

        @ExperimentalSerializationApi() final static <T extends Any> T data(Result $self, String key)

        Uses Kotlin Serialization to create an object of type T from a query result. If the key parameter is non-null, it uses the result's value for that key as the source, instead of the entire result.

        For example, if your query is SELECT name, age, shoeSize FROM people and you have a serializable Person class with properties name, age and shoeSize, you can call: val person = result.data<Person>()

        Or you could use the query SELECT * as person FROM people and create the Person with val person = result.data<Person>("person").

      • data

        @ExperimentalSerializationApi() final static <T extends DocumentModel> T data(Result $self, String key, String metaKey)

        Uses Kotlin Serialization to create a DocumentModel instance of type T from the query result. This is a specialization of the one-parameter data method that adds a metaKey parameter.

        The metaKey parameter is the name of the result property whose value comes from the N1QL meta() function; this is used to set the DocumentModel.documentMeta property of the result.

        For example, if your query is SELECT * as person, meta() as meta FROM people, you would call result.data<Person>("person", "meta").

      • data

        @ExperimentalSerializationApi() final static <T extends Any> T data(Result $self, DeserializationStrategy<T> deserializer, String key, String metaKey)
      • data

        @ExperimentalSerializationApi() final static <T extends Any> Sequence<T> data(ResultSet $self, String key)

        Returns the query rows transformed by Kotlin Serialization into instances of T.

      • data

        @ExperimentalSerializationApi() final static <T extends Any> Sequence<T> data(ResultSet $self, DeserializationStrategy<T> deserializer, String key, String metaKey)

        Returns the query rows transformed by Kotlin Serialization into instances of T.