$unset not working?
See original GitHub issueI’m having a server side method with the following code:
let updateObj = (isTyping) ? {$set: {'profile.isTyping': 1}} : {$unset: {'profile.isTyping': ''}};
Meteor.users.update(Meteor.userId(), updateObj);
The problem is that redis-oplog doesn’t reflect that change, profile.isTyping
is still available on the client side. redis-oplog sets it to null instead of removing it.
So I I do this on the client side:
Meteor.users.findOne(this.foreignUser()).profile.hasOwnProperty('isTyping')
I will get always true, because the field isn’t removed. It works without problems on MongoDB + Oplog.
Issue Analytics
- State:
- Created 7 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
unset( ) not working PHP - Stack Overflow
unset ( ) not working PHP · You've got an array of names as values, but you're trying to use the value as...
Read more >unset - Manual - PHP
It's sole purpose is to "unset" this variable, ie. to remove it from the current scope and destroy it's associated data. This is...
Read more >Unset from array not working - PHP Coding Help
blmg2009. I'm wanting to remove the 5 and 3 from the array but the following isn't working: unset($list['5']); Can you only unset the...
Read more >unset Not Working PHP Array - CodeProject
First, you are dumping $_SESSION["people"] in the "Before Array" and "After Array" blocks, but you are working with $people variable. Try to ...
Read more >$unset not working · Issue #4992 · Automattic/mongoose
I ran mongoose in debug mode and saw following query, it doesn't have $unset field. sessions.update({ isDeleted: false, 'deviceDetails.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Oh my god. After squeezing my brains for 2 hours on this one I found it. When I’m overriding observeChanges I need to pass in a clone, not an object. Bc if I pass it as reference, publishComposite does not detect any changes here:
https://github.com/englue/meteor-publish-composite/blob/master/lib/subscription.js#L66
Nice bug. Solved. Will be available in 1.1.8 release
@dnish thank you for your detailed information. I have enough to fix.