Query Json Document

Hi I tested your queries on a default bucket, works perfectly fine indeed! Good to see.

Here is an example document I try to query:

"{\"code\":\"Ok\",\"waypoints\":[{\"hint\":\"hpIQgLBBG4AMAQAAZwAAAFUAAAA7AQAA8YffQgCGK0JBjQ1CyAg-QwwBAABnAAAAVQAAADsBAABSBQAASMZKAO4QHwOCxUoARBEfAwEAfw1k4fHO\",\"location\":[4.900424,52.367598],\"name\":\"\"},{\"hint\":\"_loKgP___39ZAAAAWQAAAAUAAAAAAAAAd3t4QgAAAABDJlVAAAAAAFkAAABZAAAABQAAAAAAAABSBQAAwzJaAP8oGQNCL1oAFikZAwEAXxVk4fHO\",\"location\":[5.911235,51.980543],\"name\":\"Menthenstraat\"}],\"routes\":[{\"legs\":[{\"steps\":[],\"weight\":4558.1,\"distance\":98027.4,\"summary\":\"\",\"duration\":4539}],\"weight_name\":\"routability\",\"geometry\":\"o`s~Hsb|\\\\dcBgrA|SydArkAcfBiwAysC|fBkxEtOulExcAqrIvtAgvG~N_{EtxAi~ArhAuSvpAwgCfqBst@b~BmwEhRsjFzhBygQpkFynK|^urLwPcwHzkFxLfyAcu@ljBgcCteBca@zcDowBviA]lyAhn@bVaRrm@_xDrSguEaGw~But@mdDzAsgNjcFg}Rf^vThVuz@sXwA\",\"weight\":4558.1,\"distance\":98027.4,\"duration\":4539}]}"

I think I see the issue, it might be the escapes!

It looks like you stored as string ("{…}") instead of JSON document.

1 Like

It seems, due some former development by someone else that the data was json_encode() upfront as well, this was very wrong and I used the same lib (as I thought it was needed to encode the data before you putted it in).

Now this is much nicer to read as well! Thank you for clearing this out, it made it all more clear how to query couchbase.

@vsr1 I gave you some Karma, thanks a lot!