Created
September 5, 2014 22:31
-
-
Save neumino/c7cd56479700fd01f035 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
r.db('test').table('foo').update(function(doc) { | |
return doc.merge({foo: {channel: doc("id").add(doc("name")) }}) | |
}) |
this is what I'm currently getting with name=foobar
"foobar_error": {
"channel": "foobar_error_var_13("id")" ,
"read": true ,
"type": "test" ,
"write": false
}
@cultofmetatron -- the string concatenation is done on the server, so you must use a ReQL term to perform it.
If you replace
channel: name + '_error_' + user('id'),
with
channel: r.expr(name).add('_error_').add(user('id')),
(and the same for _success
), it should work.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
trying to make it so there will be a property on user.specificChannels and user.channels
where the value is name + '_error' and + '_success, inside is a channel property where the channel is computed by adding the user's specific id to the name.