Comments (7)
So I'm guessing that {} works for the simple case as { comes after 1-9A-Z-z e.t.c in the standard ASCII table.
But when using a JSON object as a key the opening brace matches the serialised key value and therefore excludes any row where a second key is defined.
So it seems that as you suggest, the simplest solution for me is to flatten my objects to simple properties, thereby removing the {} in the serialised key string and so allowing the basic string matching algorithm to work as expected.
But it would be useful to understand what couchbase server supports in respect to complex JSON objects as keys and eventually align couchbase-lite with that.
I have looked at the docs but they make no explicit statement about JSON objects for keys, I'll post there and see what response I get.
I'd be happy to look at patching CBL to align with couchbase server if necessary.
from couchbase-lite-ios.
Re-visiting the documentation for couchbase server, I found the following statements:
The key can be formatted in a variety of ways, including as a string or compound value (such as an array or JSON object). The content and structure of the key is important, because it is through the emitted key structure that information is selected within the view.
From one perspective it would seem make sense for CBL to support the same key types as couchbase server, but I appreciate that there may be reasons why this is not seen as desirable for CBL.
from couchbase-lite-ios.
There’s a custom SQLite comparator defined for that table column, which knows how to compare JSON values. (See CBLCollateJSON.m.)
IIRC it compares object properties in the order they appear in the respective objects, so unless the ordering is alphabetical it won’t give the right results. And I don’t think I’m canonicalizing the JSON stored in the database.
from couchbase-lite-ios.
I think what you see here is a limitation in the design of the collator. There is no sentinel value greater than {}.
Maybe an endkey like {"\ufff0":"\ufff0"}
from couchbase-lite-ios.
i also have same question.
how to query like this :"where c_user_id>10 and c_user_name ='test' " ?
from couchbase-lite-ios.
@79144876: Please ask questions on the mobile-couchbase Google group. This issue tracker is for bug reports and feature requests. Also, please describe your question more clearly; see the advice here.
from couchbase-lite-ios.
ok .thanks/
from couchbase-lite-ios.
Related Issues (20)
- `valueWouldChange` does not check whether `newValue` is a `CBLDictionary` HOT 1
- `ArrayFunction.contains` does not evaluate to correct result for boolean values HOT 2
- Module compiled with Swift 5.3.2 cannot be imported by the Swift 5.5 compiler HOT 6
- CouchbaseLite-Swift-Enterprise pod produces warning when compiling with Xcode 13 HOT 8
- Sync crashing CB lite 2.8.0 Ios 15.1 HOT 3
- Compiling issue after upgrading to Xcode 13.2.1 HOT 1
- Fleece crash during document retrieval HOT 12
- `ExpressionProtocol.isNotValued` and `isValued` functions are not available HOT 1
- setMapBlock is executing for all CBLView s instead of specific mentioned CBLView HOT 4
- Add Support for Combine Publishers HOT 1
- Add Linux Support HOT 5
- Add Nulls Ordering support HOT 2
- CouchbaseLite includes UIWebView, can it be changed to WKWebView? HOT 2
- Undefined symbol: _CBLVersion HOT 1
- “CouchbaseLiteSwift.framework” cannot be opened because the developer cannot be verified. HOT 3
- 【iOS Swift】CouchbaseLite Replicator ERROR: {Repl#935} Got LiteCore error: WebSocket error 1006, "connection closed abnormally" HOT 2
- Undefined symbols for CBLReplicatedDocument using CBL ObjC HOT 1
- After downloading the demo, it cannot be run. HOT 2
- Crash on `Query.removeChangeListener(withToken:)` HOT 14
- Swift Package Manager version of CouchbaseLiteSwift 3.1.3 crashes on `MutableDocument()` HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from couchbase-lite-ios.