SQLiteDB will not save subdoc data that does not exist on rootdoc, so we must save rootdoc first, and then save subdoc