Search code examples
javascriptnode.jsdeepstream.io

Does Deepstream keep track of the entire document in RethinkDB?


I know that Deepstream keeps track of everything in the _d-part of the document in the database and I need to use Deepstream to change anything in there which is fine. I'm wondering if I'm not allowed to change any values outside _d?

My database schema looks like this:

{
  _d: {Deepstream stuff},
  _v: 1,
  registrationCode: 'random string'
}

Now, when a user registers I will remove the registrationCode and replace it with password, like this:

{
  _d: {Deepstream stuff},
  _v: 1,
  password: 'pw string'
}

However, when Deepstream logs in on my client it will replace password with registrationCode again with the same value. My guess is that it caches the entire document, and not just whats inside _d. Is this correct?


Solution

  • That is correct. I appreciate that its a bit tedious, but in order to introduce private information like passwords etc with a record, I'd much rather create a second record, e.g. -private. This way this record can be permissioned individually and will create an individual document in RethinkDB