View contactsByState = currDb.getView("AllContactsByState");
Utils.addAllListeners(currDb);
Document doc = contacts.getFirstDocument();
DocumentCollection dc = contactsByState.getAllDocumentsByKey("CA", true);
doc.put("javaDCField", dc);
doc.save(true, false);
DocumentCollection srcDc = doc.getItemValue("javaDCField", DocumentCollection.class);
StringBuilder sb = new StringBuilder();
for (Document savedDoc : srcDc) {
sb.append(savedDoc.getNoteID());
sb.append(", ");