-
Notifications
You must be signed in to change notification settings - Fork 46
Open
Description
Sequelize now recommends using operators, which are javascript Symbols.
http://docs.sequelizejs.com/manual/tutorial/querying.html#operators-security
This causes a problem, because Symbols are ignored by JSON.stringify and Object.keys.
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol
This cache implementation uses CircularJSON to generate the cache key, so it doesn't work when using Symbols as keys.
https://www.npmjs.com/package/circular-json
Has anyone investigated a way to generate cache keys that includes Symbols?
If you need an example of this, I can provide one. To test without that, you can use the key function from Cacher:
hash = crypto.createHash('sha1')
.update(CircularJSON.stringify(this.options, jsonReplacer))
.digest('hex');
the where object to pass would be something like
{
[Op.or]: [
{firstName: {[Op.like]: 'test'}},
{lastName: {[Op.like]: 'test'}}
]
}
instead of
{
$or: [
{firstName: {$like: 'test'}},
{lastName: {$like: 'test'}}
]
}
Metadata
Metadata
Assignees
Labels
No labels