-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 07/07/13 20:51, Nico Williams wrote: > QBE is nice and simple, but lacks expressive power.
The Mongo query syntax with an example JSON object: { "a": 10, "b": {"c": 3}, "d": ["one", "two", "three"]} To find all a==10: {"a" : 10 } To find all a>=10: {"a": {"$gte": 10}} To find c==3: { "b.c": 3} To find where element two of d is "three": { "d.2": "three" } To find where "a" is present but "b" is not: {"a": {"$exists": true}, "b": {"$exists": false} } The various $operators allow expressing more deep and meaningful things: http://docs.mongodb.org/manual/reference/operator/ They are also used in updates. eg to add 3 to "a" and 4 to "b.c" {"$inc": {"a": 3, "b.c": 4}} The thing you can't do is reference objects (JOIN) in a different collection (TABLE in SQL semantics). SQL syntax is good at this. However there is less of a need due to denormalized data, and other approaches like map/reduce. It is also fairly normal to store multiple "types" in the same collection (eg songs, artists and albums) which would require different tables in SQL. I suspect multi-collection references could be squeezed into the JSON like syntax but would be ugly. It will be interesting to see who wins the query syntax mindshare. There does seem to be a desire to stay with SQL like syntax - for example Cassandra also uses it. Another thing I like about the Mongo syntax is that it is trivial to build up queries programmatically. Roger -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (GNU/Linux) iEYEARECAAYFAlHaQ6gACgkQmOOfHg372QTnWwCgl3ktXQQYguEVCo1aBn9shcE9 /+8AniZ+X+3ndxPxuaXLO6CdZLRLfC0s =qIII -----END PGP SIGNATURE----- _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users