Actually I'm going to do both. I have multiple canned databases that I'll
ship with my app. Each database has the same data, just localized to
different languages. I need the export/import ability to transfer data from
one database to another.
I'm working on the export function now, then I'll work on the import
function using this method.
One question though, if when I generate the export function I am adding a
"_revisions" string with a comma separated list of revision history IDs, do
I still need to provide the separate parameter of those revision history
IDs in that method?
Effectively, this is what one of my JSON objects looks like:
{
"sortField2Direction" : "asc",
"sortOrder" : 0,
"_revisions" :
"2-bcac0f16be912a85381a946dc5be1d82,1-6059de57a6c9b9a914f74c150b6e1442",
"groupFieldDirection" : "asc",
"oldPK" : "715BAC6E-6D39-4B65-9E4E-ECDCD45F591D",
"sortField1" : "fld-fad36b18f7c449ecb77b04d42552bd11",
"hideWhenLinked" : false,
"sortField1Direction" : "asc",
"_attachments" : {
"icon" : {
"stub" : true,
"length" : 2619,
"digest" : "sha1-Y4HUFaM0aX0048NLPNxplu5u7nQ=",
"revpos" : 2,
"content_type" : "image\/png"
}
},
"_id" : "frm-f4d442510ddb40a0b9078d1080a4e1e5",
"type" : "TFForm",
"formCategory" : "cat-bc417f04af264db88898d3a643333ade",
"_rev" : "2-bcac0f16be912a85381a946dc5be1d82",
"listViewFieldsCount" : 3,
"sortField3Direction" : "asc",
"showOnWatch" : true,
"dbID" : "db-1deccd0e15dc4047ab96eba344144f3b",
"name" : "Venues",
"shouldSync" : true
}
You can see theres a "_revisions" property in there.
I'm guessing what I'll do is just extract that string out of the JSON and
then pass it into the separate parameter in that new put method.
Thanks,
Brendan
On Thursday, March 31, 2016 at 8:29:45 AM UTC-6, Jens Alfke wrote:
>
>
> On Mar 30, 2016, at 8:50 PM, Brendan Duddridge <[email protected]
> <javascript:>> wrote:
>
> This could be that new method you were talking about which would
> facilitate importing of data. The docs imply this is a good method to use
> if you want to ship your app with some pre-canned data (which I do). Do you
> have a sample anywhere that shows that sort of thing?
>
>
> No; it’s a very new method so there’s no sample code yet. The doc-comment
> should be self-explanatory, but ask if there’s anything you don’t
> understand.
>
> The usual way to include canned data is to package a database with your
> app and install it on first launch, but if that doesn’t work for you, you
> can use this method instead.
>
> —Jens
>
>
--
You received this message because you are subscribed to the Google Groups
"Couchbase Mobile" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/mobile-couchbase/c8eaa483-2773-4862-87db-cccb5ab89040%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.