Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
假设客户端离线。在此期间,将执行以下代码:
Messages.remove(oldMessage._id) Messages.insert(newMessage)
客户端上线时,是否保证remove先执行,后insert执行?
remove
insert
换句话说,是否保证在任何时候数据库中只会出现其中一条消息?
删除将首先执行,然后插入。Meteor 将所有 DDP 消息排队,并在再次连接时按顺序执行。