Closed sumeetattree closed 10 years ago
I got the same error, probably because of the complexity of the query. I tried replacing that line with:
return JSON.stringify(query._conditions);
And it works great. Is there any reason why not only the query object is used as the key? This is the app output, with debug flag enabled, after my change:
save to cache: {"$or":[{"$and":[{"type":"group"},{"name":{"$in":["Administrator"]}}]},{"$and":[{"type":"user"},{"name":"admin"}]}]}
cache hit: {"$or":[{"$and":[{"type":"group"},{"name":{"$in":["Administrator"]}}]},{"$and":[{"type":"user"},{"name":"admin"}]}]}
cache hit: {"$or":[{"$and":[{"type":"group"},{"name":{"$in":["Administrator"]}}]},{"$and":[{"type":"user"},{"name":"admin"}]}]}
I'll change that. Thanks for the fix :)
+1
thx a bunch, could you please also push an update to npm?
It's released :)
thx :-)
Enno,
The module throws an error
TypeError: Converting circular structure to JSON
with mongoose 3.8.0.https://github.com/Gottox/mongoose-cache/blob/master/lib/cache.js#L55