|
|
@ -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... |
|
|
|
* 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) { |
|
|
|
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')) { |
|
|
|
if (k[0] === '$' && !(k === '$$date' && typeof v === 'number') && !(k === '$$deleted' && v === true) && !(k === '$$indexCreated') && !(k === '$$indexRemoved')) { |
|
|
|
throw 'Field names cannot begin with the $ character'; |
|
|
|
throw 'Field names cannot begin with the $ character'; |
|
|
|
} |
|
|
|
} |
|
|
|