Home > Database > Mysql Tutorial > mongodb中的upsert和multi

mongodb中的upsert和multi

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-07 14:58:44
Original
1556 people have browsed it

mongodb中的upsert和multi mongodb中的update的形式是这样的: db.XXX.update(query, obj, upsert, multi); 对于upsert(默认为false):如果upsert=true,如果query找到了符合条件的行, 则修改这些行,如果没有找到,则追加一行符合query和obj的行。 如果ups


mongodb中的upsert和multi

 

mongodb中的update的形式是这样的:

 

db.XXX.update(query, obj, upsert, multi);

 

对于upsert(默认为false):如果upsert=true,如果query找到了符合条件的行,

则修改这些行,如果没有找到,则追加一行符合query和obj的行。

 

如果upsert为false,找不到时,不追加。

 

对于multi(默认为false): 如果multi=true,则修改所有符合条件的行,

否则只修改第一条符合条件的行。

 

Related labels:
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Issues
mongodb start
From 1970-01-01 08:00:00
0
0
0
linux - ubuntu14 error installing mongodb
From 1970-01-01 08:00:00
0
0
0
Use of symfony2 mongodb
From 1970-01-01 08:00:00
0
0
0
mongodb _id rename
From 1970-01-01 08:00:00
0
0
0
Parameter understanding of mongodb
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template