python,rethinkdb,rethinkdb-python,reql
So as mentioned in the discussions, the numbers in the query should not be quoted, unless they are strings. Unquote the numbers should make it work.
Whenever you group something, you need to then ungroup it. So, for your query, you need to add ungroup at the end. r.table('artists')('artist')('aliases').group('name').count().ungroup() That being said, If all you want is get the number of aliases for every artist, group is not really the method for that. You're better of...
In JavaScript, (...) is the field selector. r.db("main").table("countries").limit(1)('Country')('WebName') ...
Currently, you have no index in your query, which means the database has to go through every single document filtering out by the artist. You can create an index for the nested artist name property using the indexCreate command: r .db("discogs") .table("releases") .indexCreate('artistName', r.row('release')('artists')('artist')('name')); After that, you can just get...
I would recommend making both fields always be arrays, even if the arrays sometimes only have a single value. If you do that, you can do this with concat_map: row('a').concatMap(function(a){ return row('b').map(function(b){ return a.add('-').add(b); }); }); If you want to continue using a mix of single values and arrays, you...