JVM - collection.doc.get()
Retrieve the value of a document.
import io.nitric.Nitric;import io.nitric.resources.CollectionPermission;class User {String name;int age;public User(String name, int age) {this.name = name;this.age = age;}}public class Application {public static void main(String[] args) {var profiles = Nitric.INSTANCE.collection("profiles", User.class).with(CollectionPermission.Read);var drakesProfile = profiles.doc("Drake Mallard").get();Nitric.INSTANCE.run();}}
Examples
Get a document's value
import io.nitric.Nitric;import io.nitric.resources.CollectionPermission;class User {String name;int age;public User(String name, int age) {this.name = name;this.age = age;}}public class Application {public static void main(String[] args) {var profiles = Nitric.INSTANCE.collection("profiles", User.class).with(CollectionPermission.Read);var drakesProfile = profiles.doc("Drake Mallard").get();Nitric.INSTANCE.run();}}
See also
Last updated on Dec 19, 2024