fix for safari

pull/2/head
Joshua Melville 10 years ago
parent 3bedf83b0f
commit 7283df33be
  1. 5
      lib/model.js

@ -24,6 +24,11 @@ var util = require('util')
* But you really need to want it to trigger such behaviour, even when warned not to use '$' at the beginning of the field names...
*/
function checkKey (k, v) {
if (typeof k === 'number') {
k = k.toString();
}
if (k[0] === '$' && !(k === '$$date' && typeof v === 'number') && !(k === '$$deleted' && v === true) && !(k === '$$indexCreated') && !(k === '$$indexRemoved')) {
throw 'Field names cannot begin with the $ character';
}

Loading…
Cancel
Save