我正试图观察我的集合中的变化,但我得到以下错误:"MongoError: Majority read concern requested, but it is not supported by the storage engine."。
答案似乎是:"MongoError: Majority read concern requested, but it is not supported by the storage engine. "要使用手表,你需要使用复制集,这不是mLab的一部分"。
但是我有一个付费计划,里面有一个复制集。我和mlab的连接是这样的。
mongoose.connect('mongodb://<dbuser>:<dbpassword>@ds327925-a0.mlab.com:27925,ds327925-a1.mlab.com:27925/<dbname>?replicaSet=rs-ds327925');
const taskCollection = db.collection('tasks');
const changeStream = taskCollection.watch();
changeStream.on('change', (change) => {
});
大多数人读关注 需要WiredTiger存储引擎.
WiredTiger在mlab中的可用性是。限于 "专项 "计划,显然。
除了升级你的计划,你还可以考虑迁移到MongoDB Atlas。
在MongoDB 4.2+的变化流中 不需要多数人阅读关注但我想4.2也不能在mlab中使用。