MongoDB---出现no write has been done on this connection解决
这个问题出现了好几天。日志里面一天出现几十次no write has been done on this connection, 所以研究好几天。 程序那边所做的操作就是在发生问题时,抛出getLastError 然后去查了一下getLastError的方法,W有几个值, 1:任何一台服务器写完即可进行下一步
这个问题出现了好几天。日志里面一天出现几十次no write has been done on this connection,
所以研究好几天。
程序那边所做的操作就是在发生问题时,抛出getLastError
然后去查了一下getLastError的方法,W有几个值,
1:任何一台服务器写完即可进行下一步操作。
2:必须要有2台完成。
0:则是不考虑写完成与否,继续写操作。
还有一个数值就是majority。查看官方文档后,我的理解是,大于2的值都用majority。下面是官方的解释
以上是官方对几个参数的全部解释。
还有一个值是j,true,false,true就打开日志记录。
举个例子,w:1,j:true,那么,就必须要一台服务器写操作完成后,并且将操作写进journal,然后才可以进行下一步操作。
图中可以看到,必须写完journal才能返回有效值。
从红线部分,可以看出,majority会替代大于2的数字,
回到题目,报那个错,最后发现是版本问题。我们可以通过以下方法验证,在2.2上,对一个空集合进行remove操作,然后马上输入getLastError(w:1),就会返回题目的错误,但是在2.6上,就不会。

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics



Overview of how to draw 3D geographic charts with Python: Drawing 3D geographic charts can help us understand geographic data and spatial distribution more intuitively. Python, as a powerful and easy-to-use programming language, provides many libraries and tools for drawing various types of geographical charts. In this article, we will learn how to draw 3D geographic charts using the Python programming language and some popular libraries such as Matplotlib and Basemap. Environment preparation: Before starting, we need to make sure

How to use Vue to achieve 3D three-dimensional rotation effects As a popular front-end framework, Vue.js plays an important role in developing dynamic web pages and applications. It provides an intuitive, efficient way to build interactive interfaces and is easy to integrate and extend. This article will introduce how to use Vue.js to implement a stunning 3D stereoscopic rotation effect, and provide specific code examples. Before you start, make sure you have Vue.js installed and have some understanding of the basic usage of Vue.js. If you still

How to use Vue and Canvas to create cool 3D rotating graphics Introduction: Vue and Canvas are two very powerful front-end technologies. They are good at handling page rendering and image drawing respectively. This article will introduce how to combine Vue and Canvas to create cool 3D rotating graphics effects. We will explore how to use Vue to build a basic page structure, and how to use Canvas to achieve the drawing and rotation effects of 3D graphics. By studying this article, you will be able to understand how to utilize Vue and Canvas

How to use Vue to implement 3D flipping effects Introduction: Vue.js is a popular JavaScript framework that can help us build highly interactive web applications. In this article, we will explore how to use Vue.js to implement a cool 3D flip effect and provide specific code examples for reference. Introduction: 3D flip effects can add some interactivity and attraction to our website or application. As a flexible and easy-to-use front-end framework, Vue.js can easily achieve this

Write in python is a method of writing a string into a file. The syntax format is "fileObject.write([str])", where str refers to the string to be written to the file.

Highcharts is a very popular JavaScript charting library that provides many different types of charts, including 3D charts. This article will introduce in detail how to use 3D charts to display data in Highcharts, and provide specific code examples. Introducing the Highcharts library First, we need to introduce the Highcharts library into the HTML file. This can be achieved by: <scriptsrc="https://

Writing a string to a file using Java's FileWriter.write() function In Java, the FileWriter class is a class used to write character data to a file. It provides a series of methods for writing characters to files, one of the most commonly used methods is the write() function. This article will introduce how to use the write() function to write a string to a file and provide corresponding code examples. Create a FileWriter object First, we need to create a FileWrit

Taobao Winner’s February 2 question: When did the earliest slimming tea appear in my country? When did the earliest slimming tea appear in my country? Then the editor will bring you today’s answer to the 2.2 Taobao winner’s daily guess. Friends who are interested can come and find out. Taobao Daily Guess Answers Taobao Big Winner February 2: When did the earliest slimming tea appear in my country? Question: When did the earliest slimming tea appear in my country? Answer: C. Song Dynasty Answer analysis: 1. Click here to find out For clues, you can find the answer to the question on the page as shown below; 2. "Jisheng Prescription" written by Yan Yonghe, a famous doctor in the Song Dynasty, recorded the earliest weight loss-Qipi Drink; 3. Take the big belly peel, tangerine peel, Ginger peel, poria peel, ground bone peel, licorice peel and green peel each in half, grind into powder and set aside
