One thing i cant figure is how to correctly pass a combined key using the
php api...
$keyTabla = array(Conexion::getDataBaseName(), $this->_tabla, $channelCb);
// Conexion::getCbCnn() is my CouchBase Connection
$consultaActuales = Conexion::getCbCnn()->view("mobile_sync",
"docsbybd_tabla_usuario", array("keys" => array($keyTabla)));
is this correct as $consultaActuales is returning this.
array (
'total_rows' => 112,
'rows' =>
array (
),
)
But querying in CouchBase console gives me plenty of records like this...
{"total_rows":112,"rows":[
{"id":"bd_advisor_bio_col.especialidades.10","key":["bd_advisor_bio_col",
"tb_especialidad","bd_advisor_bio_col-repre"],"value":{"_sync":{"rev":
"8-5cd849c6b68ce24b014c83faa97edabf","sequence":703,"history":{"revs":[
"1-cceba4bd90e12833eb30e3d01abd5698","2-77098e4612bafcb85d5155e87f1cce64",
"3-d82e959606a09788fcaf40fba74e7c89","4-2a608d87500ad004de63b37dfbde0553",
"5-de4701a30d36300c1ccbd3038ea9bced","6-bf7de41ae4e9b3c62f6106b1e0702429",
"7-a85f754d363cc6261074b199a5824fe0","8-5cd849c6b68ce24b014c83faa97edabf"],
"parents":[-1,0,1,2,3,4,5,6],"bodies":["","","","","","","",""],"channels"
:[["bd_advisor_bio_col-todos"],["bd_advisor_bio_col-todos"],[
"bd_advisor_bio_col-todos"],["bd_advisor_bio_col-todos"],[
"bd_advisor_bio_col-todos"],["bd_advisor_bio_col-todos"],[
"bd_advisor_bio_col-todos"],["bd_advisor_bio_col-todos"]]},"channels":{
"bd_advisor_bio_col-todos":null},"access":{"bd_advisor_bio_col-todos":{
"bd_advisor_bio_col-repre":6}}},"abreviatura":"INT","cod_especialidad":"10",
"hash_dispositivo":"1363817094","hash_servidor":"1363817094",
"nombre_especialidad":"MEDICINA INTERNA","pmsync_bd":"bd_advisor_bio_col",
"pmsync_channels":["bd_advisor_bio_col-todos"],"pmsync_usuario":
"bd_advisor_bio_col-repre","type":"tb_especialidad"}}
]
}
El viernes, 6 de diciembre de 2013 18:36:36 UTC-5, Frederic Yesid Peña
Post by Frederic Yesid Peña SánchezThanks, i also figured to make my views ommit "_sync" keys
El viernes, 6 de diciembre de 2013 16:55:40 UTC-5, Frederic Yesid Peña
Post by Frederic Yesid Peña SánchezPost by Jens AlfkeThe gateway API uses multiversion concurrency control (MVCC) for
document updates. To update a document you need to provide the revision ID
(_rev field) of the revision youre replacing, and the server will return
that 409 error if theres a mismatch. This catches conflicts due to race
conditions where two clients try to update the document at the same time.
The usual procedure for updating is
GET /db/docid
update the JSON properties, leaving _rev and _id alone
PUT /db/docid
if the response is 409, retry from step 1
It isnt strictly necessary to do the GET every time, as long as you
remember the previous data you PUT (or just the _rev field). But upon a 409
conflict you have to do a GET to catch up with what someone else changed.
Hi, i'm trying to do some mixup with a PHP application and CBL on
I'm doing the update with '_id & _rev', it's normal that SyncGateway log
says "Added doc "xxx" / "3-xxxxxx" even on update???
Thanks
--
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 mobile-couchbase+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
To view this discussion on the web visit https://groups.google.com/d/msgid/mobile-couchbase/bfb5aff4-4af5-4aac-a162-29aadc23c0d0%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.