use of com.couchbase.client.java.json.JsonArray in project couchbase-jvm-clients by couchbase.
the class GetProjectionIntegrationTest method attributes_hobbies_1_type.
@Test
void attributes_hobbies_1_type() {
JsonObject decoded = collection.get(DOC_ID, getOptions().project("attributes.hobbies[1].type")).contentAsObject();
JsonArray arr = decoded.getObject("attributes").getArray("hobbies");
assertEquals(1, arr.size());
assertEquals("summer sports", arr.getObject(0).getString("type"));
assertEquals(1, decoded.size());
}
use of com.couchbase.client.java.json.JsonArray in project couchbase-jvm-clients by couchbase.
the class GetProjectionIntegrationTest method animals_1.
@Test
void animals_1() {
JsonObject decoded = collection.get(DOC_ID, getOptions().project("animals[1]")).contentAsObject();
JsonArray arr = decoded.getArray("animals");
assertEquals(1, arr.size());
assertEquals("dog", arr.get(0));
assertEquals(1, decoded.size());
}
use of com.couchbase.client.java.json.JsonArray in project couchbase-jvm-clients by couchbase.
the class GetProjectionIntegrationTest method animals_2.
@Test
void animals_2() {
JsonObject decoded = collection.get(DOC_ID, getOptions().project("animals[2]")).contentAsObject();
JsonArray arr = decoded.getArray("animals");
assertEquals(1, arr.size());
assertEquals("parrot", arr.get(0));
assertEquals(1, decoded.size());
}
Aggregations