RethinkDB Map/Reduce examples

308 views Asked by At

I running through the Map/Reduce examples in the RethinkDB docs. I have some documents that look like this:

{
"category":  "Fiction" ,
"content":  "This far, no further!" ,
"id":  "0fc5339b-8139-4996-8979-88a0051195e3" ,
"title":  "The line must be drawn here"
}

When I follow the examples using Data Explorer. e.g.

r.table('posts').map(lambda post: 1)

I get this error:

SyntaxError: missing ) after argument list
1

There are 1 answers

0
deontologician On BEST ANSWER

This is because the Data Explorer only allows JavaScript as an input. You need to switch to something like this to make it work:

r.table('posts').map(function(post){return 1})