1
A
回答
1
MongoDB的刀片是默認一種異步的,因爲它的發射後不管。錯誤檢查是明確的操作,或者您必須在驅動程序級別啓用安全模式。 如果您需要真正的異步操作:使用消息隊列。
0
在緩存世界中,'lazy-persistence'將被稱爲寫後置(write-behind)。看看這個:Cache/Wikipedia
的代碼看起來是這樣的:
定義自己的委託:
private delegate void InsertDelegate(BsonDocument doc);
使用它
MongoCollection<BsonDocument> books = database.GetCollection<BsonDocument>("books"); BsonDocument book = new BsonDocument { { "author", "Ernest Hemingway" }, { "title", "For Whom the Bell Tolls" } }; var insert = new InsertDelegate(books.Insert); // invoke the method asynchronously IAsyncResult result = insert.BeginInvoke(book, null, null); // DO YOUR OWN WORK HERE // get the result of that asynchronous operation insert.EndInvoke(result);
希望 幫助。
相關問題
- 1. Mongodb異步插入
- 2. 如何向mongodb中的日誌插入異步?
- 3. 異步插入&更新異步插入&更新:NoSql和SQL
- 4. 異步批量(批量)通過Node.js插入到MySQL(或MongoDB?)
- 5. 異步可插入協議
- 6. 使用MongoDB的WPF C#異步MVVM
- 7. 將記錄異步插入到MsAccess中
- 8. 將一段異步代碼插入到C++函數中
- 9. 插入數據在MongoDB中
- 10. 插入向量C++
- 11. 帶有異步批量插入的MongoDb中的自動增量字段
- 12. 插入和MongoDB中
- 13. 在隊列向量中插入C++
- 14. C++不能在向量中插入值
- 15. MongoDb forEach異步回調
- 16. 通過pymongo在MongoDB中插入數據時的差異
- 17. 同步寫入MongoDB
- 18. 插座異步在AS3
- 19. 多插入使用異步等待
- 20. 多個異步Ado.net SQL插入
- 21. Sqlite3異步插入和更新
- 22. 使用異步插入協議
- 23. 插入圖像獲取異步錯誤
- 24. 異步插入Oracle,有什麼好處?
- 25. 異步任務後插入UIViewtable
- 26. 如何在c/C++中實現異步寫入?
- 27. 在mongodb函數上的異步回調
- 28. 節點中的Mongodb的異步腳本
- 29. 插入ArrayList mongodb
- 30. 異步雙向RPC