A fast, low memory, transactional, index & query enabled NoSQL database engine and server for node.js and browser with realtime data change notifications
MIT License
491
stars
27
forks
source link
Fix `target` of `mutations` events on wildcard paths #230
If mutations or notify_mutations are set on a path containing wildcards (* or named variables), the mutation's target is not being set correctly.
Example:
db.ref('users/*/books').on('mutations', (mutations) => {
mutations.forEach(snap => {
const m = snap.val();
const target = m.target;
// if mutation is on `users/user1/books/book1/title`, target contains ['ooks', 'book1', 'title']
// but target should be ['book1', 'title']
});
});
TODO: snap.ref.path probably contains users/*/books, but should be users/user1/books in above example. Check this, fix it if true.
If
mutations
ornotify_mutations
are set on a path containing wildcards (* or named variables), the mutation'starget
is not being set correctly.Example:
TODO:
snap.ref.path
probably containsusers/*/books
, but should beusers/user1/books
in above example. Check this, fix it if true.