use of com.torodb.kvdocument.values.KvDocument in project torodb by torodb.
the class D2RTranslationBatchFunction method apply.
@Override
public CollectionData apply(List<KvDocument> docs) {
metaDocCollection.newBatch();
D2RTranslator translator = translatorFactory.createTranslator(metaDatabase, metaDocCollection);
for (KvDocument doc : docs) {
translator.translate(doc);
}
return translator.getCollectionDataAccumulator();
}
use of com.torodb.kvdocument.values.KvDocument in project torodb by torodb.
the class TestConvertJson method parseMultiArrayEmpty.
@Test
public void parseMultiArrayEmpty() {
KvDocument doc = parser.createFromResource("MultiArrayEmpty.json");
KvArray array = (KvArray) doc.get("months");
assertEquals(1, array.size());
assertTrue(array.get(0) instanceof KvArray);
KvArray inner = (KvArray) array.get(0);
assertEquals(0, inner.size());
}
use of com.torodb.kvdocument.values.KvDocument in project torodb by torodb.
the class TestConvertJson method parseEmptyArray.
@Test
public void parseEmptyArray() {
KvDocument doc = parser.createFromResource("EmptyArray.json");
assertTrue(doc.containsKey("department"));
assertTrue(doc.get("department") instanceof KvArray);
assertTrue(((KvArray) doc.get("department")).size() == 0);
}
use of com.torodb.kvdocument.values.KvDocument in project torodb by torodb.
the class TestConvertJson method parseEmptyJson.
@Test
public void parseEmptyJson() {
KvDocument doc = parser.createFromResource("Empty.json");
assertEquals(0, doc.size());
}
use of com.torodb.kvdocument.values.KvDocument in project torodb by torodb.
the class TestConvertJson method parseSubDocument.
@Test
public void parseSubDocument() {
KvDocument doc = parser.createFromResource("SubDocument.json");
assertTrue(doc.containsKey("address"));
assertTrue(doc.get("address") instanceof KvDocument);
}
Aggregations