{"id":270389,"date":"2015-12-15T13:53:02","date_gmt":"2015-12-15T10:53:02","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=270389"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=270389","title":{"rendered":"\u0420\u0435\u043b\u0438\u0437 mongodb 2.3 \u043d\u0435\u043c\u043d\u0433\u043e \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e\u0441\u0442\u0435\u0439"},"content":{"rendered":"<p>       <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/e36\/58a\/ca6\/e3658aca69ab496895f5bc53c7357632.jpeg\"\/><br \/>  \u041d\u0430 \u0434\u043d\u044f\u0445 \u0432\u044b\u0448\u0435\u043b \u043d\u043e\u0432\u044b\u0439 \u0441\u0442\u0430\u0431\u0438\u043b\u044c\u043d\u044b\u0439 \u0440\u0435\u043b\u0438\u0437 <code>mongodb<\/code>. \u0412 \u044d\u0442\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0438 \u0431\u044b\u043b \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d \u0440\u044f\u0434 \u043d\u043e\u0432\u043e\u0432\u0432\u0435\u0434\u0435\u043d\u0438\u0439 \u0442\u0430\u043a\u0438\u0445 \u043a\u0430\u043a \u043d\u043e\u0432\u044b\u0439 <code>GUI<\/code> \u0434\u043b\u044f \u0432\u0438\u0437\u0443\u0430\u043b\u044c\u043d\u043e\u0439 \u0440\u0430\u0431\u043e\u0442\u044b \u0441 <code>mongodb<\/code>, <code>INNER JOIN<\/code>, \u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u044f \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430 \u0438 \u0442.\u0434. \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0438\u0437 \u044d\u0442\u0438\u0445 \u0441\u0432\u043e\u0439\u0441\u0442\u0432 \u043c\u044b \u0438 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043d\u0430 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0438\u0445 \u043f\u0440\u0438\u043c\u0435\u0440\u0430\u0445 \u043d\u0438\u0436\u0435.   <\/p>\n<ul>\n<li><a href=\"#0\"> \u0427\u0430\u0441\u0442\u0438\u0447\u043d\u044b\u0439 ( partial ) \u0438\u043d\u0434\u0435\u043a\u0441 <\/a><\/li>\n<li><a href=\"#1\"> \u0412\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u044f <\/a><\/li>\n<li><a href=\"#2\"> \u041d\u043e\u0432\u043e\u0432\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u0430\u0433\u0440\u0435\u0433\u0430\u0446\u0438\u043e\u043d\u043d\u043e\u0433\u043e \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0430 <\/a><\/li>\n<li><a href=\"#3\"> \u041d\u043e\u0432\u044b\u0435 \u043e\u043f\u0446\u0438\u0438 \u0432 \u0443\u0442\u0438\u043b\u0438\u0442\u0430\u0445 \u0438\u043c\u043f\u043e\u0440\u0442\u0430 \u044d\u043a\u0441\u043f\u043e\u0440\u0442\u0430<\/a><\/li>\n<li><a href=\"#5\"> \u041d\u043e\u0432\u043e\u0432\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u0432 CRUD<\/a><\/li>\n<li><a href=\"#6\"> WiredTiger \u0438 fsyncLock<\/a><\/li>\n<li><a href=\"#7\"> \u041d\u043e\u0432\u043e\u0435 GUI compass<\/a><\/li>\n<\/ul>\n<p>  <a name=\"habracut\"><\/a>  <\/p>\n<h3><a name=\"0\"><\/a><font color=\"orange\"> \u0427\u0430\u0441\u0442\u0438\u0447\u043d\u044b\u0439 ( partial ) \u0438\u043d\u0434\u0435\u043a\u0441 <\/font><\/h3>\n<p>  <code>MongoDB 3.2<\/code> \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u0438\u043d\u0434\u0435\u043a\u0441\u044b \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u043b\u044f \u0442\u0435\u0445 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u043e\u0432 \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0431\u0443\u0434\u0443\u0442 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u043e\u043c\u0443 \u0444\u0438\u043b\u044c\u0442\u0440\u0443. \u0418\u043d\u0434\u0435\u043a\u0441\u0430\u0446\u0438\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u0447\u0430\u0441\u0442\u0438 \u043d\u0443\u0436\u043d\u044b\u0445 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u043e\u0432 \u0432 \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u0438, \u0438\u043c\u0435\u0435\u0442 \u0440\u044f\u0434 \u043f\u043b\u044e\u0441\u043e\u0432, \u0442\u0430\u043a\u0438\u0445 \u043a\u0430\u043a \u0431\u043e\u043b\u0435\u0435 \u043d\u0438\u0437\u043a\u0438\u0435 \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u044f \u043a \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044e, \u0438 \u0441\u043d\u0438\u0436\u0435\u043d\u0438\u0435 \u0437\u0430\u0442\u0440\u0430\u0442 \u043d\u0430 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c, \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0438 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0430\u043d\u0438\u044f \u0438\u043d\u0434\u0435\u043a\u0441\u0430. \u0412\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u043e\u043f\u0446\u0438\u044e <code>partialFilterExpression<\/code> \u0434\u043b\u044f \u0432\u0441\u0435\u0445 <a href=\"https:\/\/docs.mongodb.org\/manual\/core\/index-types\/\">\u0442\u0438\u043f\u043e\u0432<\/a> \u0438\u043d\u0434\u0435\u043a\u0441\u0430 <code>MongoDB<\/code>.<\/p>\n<p>  \u0414\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0447\u0430\u0441\u0442\u0438\u0447\u043d\u043e\u0433\u043e \u0438\u043d\u0434\u0435\u043a\u0441\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043c\u0435\u0442\u043e\u0434 <code>db.collection.createIndex()<\/code> \u0441 \u043d\u043e\u0432\u043e\u0439 \u043e\u043f\u0446\u0438\u0435\u0439 <code>partialFilterExpression<\/code>. \u0412 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0441\u043e\u0441\u0442\u0430\u0432\u043d\u043e\u0439 \u0438\u043d\u0434\u0435\u043a\u0441, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u0438\u043d\u0434\u0435\u043a\u0441\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u0442\u0435 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u044b, \u0443 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0440\u0435\u0439\u0442\u0438\u043d\u0433 \u0431\u043e\u043b\u044c\u0448\u0435 5.  <\/p>\n<pre><code class=\"python\">db.restaurants.createIndex(    { cuisine: 1, name: 1 },    { partialFilterExpression: { rating: { $gt: 5 } } } ) <\/code><\/pre>\n<p>  <\/p>\n<h4>\u0421\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435 \u0441 \u0440\u0430\u0437\u0440\u0435\u0436\u0435\u043d\u043d\u044b\u043c \u0438\u043d\u0434\u0435\u043a\u0441\u043e\u043c.<\/h4>\n<p>  \u0427\u0430\u0441\u0442\u0438\u0447\u043d\u044b\u0439 \u0438\u043d\u0434\u0435\u043a\u0441 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0431\u043e\u043b\u044c\u0448\u0438\u0439 \u043d\u0430\u0431\u043e\u0440 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0435\u0439, \u0447\u0435\u043c \u0440\u0430\u0437\u0440\u0435\u0436\u0435\u043d\u043d\u044b\u0439 \u0438\u043d\u0434\u0435\u043a\u0441 \u0438 \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0431\u043e\u043b\u0435\u0435 \u043f\u0440\u0435\u0434\u043f\u043e\u0447\u0442\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u043c. \u0427\u0430\u0441\u0442\u0438\u0447\u043d\u044b\u0439 \u0438\u043d\u0434\u0435\u043a\u0441, \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u0435\u0442 \u0431\u043e\u043b\u0435\u0435 \u0432\u044b\u0440\u0430\u0437\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c, \u0434\u043b\u044f \u0443\u043a\u0430\u0437\u0430\u043d\u0438\u044f \u043a\u0430\u043a\u0438\u0435 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u044b \u043b\u0443\u0447\u0448\u0435 \u0438\u043d\u0434\u0435\u043a\u0441\u0438\u0440\u043e\u0432\u0430\u0442\u044c.<br \/>  \u0420\u0430\u0437\u0440\u0435\u0436\u0435\u043d\u043d\u044b\u0435 \u0438\u043d\u0434\u0435\u043a\u0441\u044b \u0432\u044b\u0431\u0438\u0440\u0430\u044e\u0442 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u044b \u0434\u043b\u044f \u0438\u043d\u0434\u0435\u043a\u0441\u0430\u0446\u0438\u0438 \u0438\u0441\u043a\u043b\u044e\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0430\u043d\u0438\u0438 \u043d\u0430\u043b\u0438\u0447\u0438\u044f \u0438\u043d\u0434\u0435\u043a\u0441\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0433\u043e \u043f\u043e\u043b\u044f.<br \/>  \u041f\u0440\u0438\u043c\u0435\u0440 \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u0440\u0430\u0437\u0440\u0435\u0436\u0435\u043d\u043d\u043e\u0433\u043e \u0438\u043d\u0434\u0435\u043a\u0441\u0430 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0447\u0430\u0441\u0442\u0438\u0447\u043d\u043e\u0433\u043e \u0438\u043d\u0434\u0435\u043a\u0441\u0430:  <\/p>\n<pre><code class=\"python\">db.contacts.createIndex(    { name: 1 },    { partialFilterExpression: { name: { $exists: true } } } ) <\/code><\/pre>\n<p>  \u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0435\u0449\u0435 \u043e\u0434\u0438\u043d \u043f\u0440\u0438\u043c\u0435\u0440 \u0441 \u0447\u0430\u0441\u0442\u0438\u0447\u043d\u044b\u043c \u0438\u043d\u0434\u0435\u043a\u0441\u043e\u043c, \u0442\u0443\u0442 \u043f\u043e\u043b\u0435 \u043f\u043e \u043a\u043e\u0442\u043e\u0440\u043e\u043c\u0443 \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u043e\u0432\u043e\u0434\u0438\u0442\u044c\u0441\u044f \u0438\u043d\u0434\u0435\u043a\u0441\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 <code>name<\/code>, \u0430 \u043f\u043e\u043b\u0435, \u043f\u043e \u043a\u043e\u0442\u043e\u0440\u043e\u043c\u0443 \u0431\u0443\u0434\u0443\u0442 \u043e\u0442\u0444\u0438\u043b\u044c\u0442\u0440\u043e\u0432\u0430\u043d\u044b \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u044b, \u0434\u0440\u0443\u0433\u043e\u0435:  <\/p>\n<pre><code class=\"python\">db.contacts.createIndex(    { name: 1 },    { partialFilterExpression: { email: { $exists: true } } } ) <\/code><\/pre>\n<p>  \u0421\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u0437\u0430\u043f\u0440\u043e\u0441 \u043c\u043e\u0436\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0438\u043d\u0434\u0435\u043a\u0441:  <\/p>\n<pre><code class=\"python\">db.contacts.find( { name: &quot;xyz&quot;, email: { $regex: \/\\.org$\/ } } ) <\/code><\/pre>\n<p>  \u0410 \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u0438\u043d\u0434\u0435\u043a\u0441 \u043d\u0435 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d:  <\/p>\n<pre><code class=\"python\">db.contacts.find( { name: &quot;xyz&quot;, email: { $exists: false } } ) <\/code><\/pre>\n<p>  <\/p>\n<h4>\u041e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u044f<\/h4>\n<p>  \u0412 <code>mongodb<\/code> \u043d\u0435\u043b\u044c\u0437\u044f \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0432\u0435\u0440\u0441\u0438\u0439 \u0438\u043d\u0434\u0435\u043a\u0441\u0430, \u043e\u0442\u043b\u0438\u0447\u0430\u044e\u0449\u0438\u0445\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u043c\u0438. \u041d\u0435\u043b\u044c\u0437\u044f \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u043c\u043d\u043e\u0433\u043e \u0447\u0430\u0441\u0442\u0438\u0447\u043d\u044b\u0445 \u0438\u043d\u0434\u0435\u043a\u0441\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043e\u0442\u043b\u0438\u0447\u0430\u044e\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u043c\u0438 \u0444\u0438\u043b\u044c\u0442\u0440\u0430.<br \/>  \u0412 \u0431\u043e\u043b\u0435\u0435 \u0440\u0430\u043d\u043d\u0438\u0445 \u0432\u0435\u0440\u0441\u0438\u044f\u0445 <code>mongodb<\/code> \u043d\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u043b\u0438\u0441\u044c \u0447\u0430\u0441\u0442\u0438\u0447\u043d\u044b\u0435 \u0438\u043d\u0434\u0435\u043a\u0441\u044b. \u0412\u0441\u0435 <code>sharded<\/code> \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u044b, \u043d\u0430\u0431\u043e\u0440\u044b \u0440\u0435\u043f\u043b\u0438\u043a \u0438 \u0432\u0441\u0435 \u0443\u0437\u043b\u044b \u0434\u043e\u043b\u0436\u043d\u044b \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u043d\u0430 <code>mongodb 3.2<\/code>.<br \/>  <code>_id<\/code> \u0438\u043d\u0434\u0435\u043a\u0441 \u043d\u0435 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0447\u0430\u0441\u0442\u0438\u0447\u043d\u044b\u043c \u0438\u043d\u0434\u0435\u043a\u0441\u043e\u043c.<br \/>  \u041a\u043b\u044e\u0447 \u0442\u0430\u043a\u0436\u0435 \u0448\u0430\u0440\u0434\u0430 \u043d\u0435 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0447\u0430\u0441\u0442\u0438\u0447\u043d\u044b\u043c \u0438\u043d\u0434\u0435\u043a\u0441\u043e\u043c.<\/p>\n<p>  \u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u044e <code>restaurants<\/code>, \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0449\u0443\u044e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u044b \u0438 \u0432\u044b\u0433\u043b\u044f\u0434\u044f\u0449\u0438\u0435 \u0442\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:  <\/p>\n<pre><code class=\"python\">{    &quot;_id&quot; : ObjectId(&quot;5641f6a7522545bc535b5dc9&quot;),    &quot;address&quot; : {       &quot;building&quot; : &quot;1007&quot;,       &quot;coord&quot; : [ -73.856077,  40.848447 ],       &quot;street&quot; : &quot;Morris Park Ave&quot;,       &quot;zipcode&quot; : &quot;10462&quot;    },    &quot;borough&quot; : &quot;Bronx&quot;,    &quot;cuisine&quot; : &quot;Bakery&quot;,    &quot;rating&quot; : { &quot;date&quot; : ISODate(&quot;2014-03-03T00:00:00Z&quot;),                 &quot;grade&quot; : &quot;A&quot;,                 &quot;score&quot; : 2               },    &quot;name&quot; : &quot;Morris Park Bake Shop&quot;,    &quot;restaurant_id&quot; : &quot;30075445&quot; } <\/code><\/pre>\n<p>  \u041c\u044b \u043c\u043e\u0433\u043b\u0438 \u0431\u044b \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0438\u043d\u0434\u0435\u043a\u0441 \u043d\u0430 \u043f\u043e\u043b\u044f <code>borough<\/code> \u0438 <code>cuisine<\/code> \u043e\u0442\u0444\u0438\u043b\u044c\u0442\u0440\u043e\u0432\u0430\u0432 \u0442\u043e\u043b\u044c\u043a\u043e \u0442\u0435 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u044b \u0433\u0434\u0435 <code>rating.grade == A<\/code>  <\/p>\n<pre><code class=\"python\">db.restaurants.createIndex(    { borough: 1, cuisine: 1 },    { partialFilterExpression: { 'rating.grade': { $eq: &quot;A&quot; } } } ) <\/code><\/pre>\n<p>  \u0421\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u0437\u0430\u043f\u0440\u043e\u0441 \u043f\u043e \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u0438 <code>restaurants<\/code> \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0449\u0438\u0439 \u0447\u0430\u0441\u0442\u0438\u0447\u043d\u044b\u0439 \u0438\u043d\u0434\u0435\u043a\u0441 \u0432\u0435\u0440\u043d\u0435\u0442 \u0432\u0441\u0435 \u0440\u0435\u0441\u0442\u043e\u0440\u0430\u043d\u044b \u043d\u0430\u0445\u043e\u0434\u044f\u0449\u0438\u0435\u0441\u044f \u0432 <code>Bronx<\/code> \u0433\u0434\u0435 <code>rating.grade<\/code> \u044d\u043a\u0432\u0438\u0432\u0430\u043b\u0435\u043d\u0442\u043d\u044b\u0439 <code>A<\/code>  <\/p>\n<pre><code class=\"python\">db.restaurants.find( { borough: &quot;Bronx&quot;, 'rating.grade': &quot;A&quot; } ) <\/code><\/pre>\n<p>  \u0410 \u044d\u0442\u043e\u0442 \u0437\u0430\u043f\u0440\u043e\u0441, \u043d\u0435 \u0441\u043c\u043e\u0436\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0438\u043d\u0434\u0435\u043a\u0441, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u043d\u0435\u0442 \u043f\u043e\u043b\u0435\u0439, \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0445 <code>rating.grade<\/code>  <\/p>\n<pre><code class=\"python\">db.restaurants.find( { borough: &quot;Bronx&quot;, cuisine: &quot;Bakery&quot; } ) <\/code><\/pre>\n<p>  <\/p>\n<h4>\u0427\u0430\u0441\u0442\u0438\u0447\u043d\u044b\u0439 \u0438\u043d\u0434\u0435\u043a\u0441 \u0441 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u0435\u043c \u0443\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u0438<\/h4>\n<p>  \u0427\u0430\u0441\u0442\u0438\u0447\u043d\u044b\u0439 \u0438\u043d\u0434\u0435\u043a\u0441 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d \u043a \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u043c, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442 <a href=\"https:\/\/docs.mongodb.org\/manual\/core\/index-unique\/#index-type-unique\">\u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u0435 \u0443\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u0438<\/a>. <\/p>\n<p>  \u0414\u043b\u044f \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u0432\u043e\u0437\u044c\u043c\u0435\u043c \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u044e <code>users<\/code> \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0449\u0443\u044e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u044b:  <\/p>\n<pre><code class=\"python\">{ &quot;_id&quot; : ObjectId(&quot;56424f1efa0358a27fa1f99a&quot;), &quot;username&quot; : &quot;david&quot;, &quot;age&quot; : 29 } { &quot;_id&quot; : ObjectId(&quot;56424f37fa0358a27fa1f99b&quot;), &quot;username&quot; : &quot;amanda&quot;, &quot;age&quot; : 35 } { &quot;_id&quot; : ObjectId(&quot;56424fe2fa0358a27fa1f99c&quot;), &quot;username&quot; : &quot;rajiv&quot;, &quot;age&quot; : 57 } <\/code><\/pre>\n<p>  \u0421\u043b\u0435\u0434\u0443\u044e\u0449\u0430\u044f \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044f, \u0441\u043e\u0437\u0434\u0430\u0441\u0442 \u0438\u043d\u0434\u0435\u043a\u0441, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0430\u043a\u043b\u0430\u0434\u044b\u0432\u0430\u0435\u0442 \u0443\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u043e\u0435 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u0435 \u043d\u0430 \u043f\u043e\u043b\u0435 <code>username<\/code> \u0438 \u0447\u0430\u0441\u0442\u0438\u0447\u043d\u044b\u0439 \u0444\u0438\u043b\u044c\u0442\u0440 \u0434\u043b\u044f \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f <code>age: { $gte: 21 }<\/code>  <\/p>\n<pre><code class=\"python\">db.users.createIndex(    { username: 1 },    { unique: true, partialFilterExpression: { age: { $gte: 21 } } } ) <\/code><\/pre>\n<p>  \u0418\u043d\u0434\u0435\u043a\u0441 \u043f\u0440\u0435\u0434\u043e\u0442\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0432\u0441\u0442\u0430\u0432\u043a\u0443 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0445 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u043e\u0432, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u044b \u0441 \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u044b\u043c \u0438\u043c\u0435\u043d\u0435\u043c \u0443\u0436\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0442 \u0438 \u043f\u043e\u043b\u0435 <code>age<\/code> \u0431\u043e\u043b\u044c\u0448\u0435 21:  <\/p>\n<pre><code class=\"python\">db.users.insert( { username: &quot;david&quot;, age: 27 } ) db.users.insert( { username: &quot;amanda&quot;, age: 25 } ) db.users.insert( { username: &quot;rajiv&quot;, age: 32 } ) <\/code><\/pre>\n<p>  \u0410 \u044d\u0442\u0438 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u044b \u0431\u0443\u0434\u0443\u0442 \u0432\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u044b:  <\/p>\n<pre><code class=\"python\">db.users.insert( { username: &quot;david&quot;, age: 20 } ) db.users.insert( { username: &quot;amanda&quot; } ) db.users.insert( { username: &quot;rajiv&quot;, age: null } ) <\/code><\/pre>\n<h3><a name=\"1\"><\/a><font color=\"orange\"> \u0412\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u044f<\/font><\/h3>\n<p>  \u041d\u0430\u0447\u0438\u043d\u0430\u044f \u0441 \u0432\u0435\u0440\u0441\u0438\u0438 <code>3.2<\/code>, mongodb, \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u043e\u0432 \u0432 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0435 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f \u0438 \u0432\u0441\u0442\u0430\u0432\u043a\u0438. \u041f\u0440\u0430\u0432\u0438\u043b\u0430 \u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u0438 \u0437\u0430\u0434\u0430\u044e\u0442\u0441\u044f \u043f\u0440\u0438 \u044f\u0432\u043d\u043e\u043c \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0438 \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u0438 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043e\u043f\u0446\u0438\u0438 <code>validator<\/code>, \u043b\u0438\u0431\u043e \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043a\u043e\u043c\u0430\u043d\u0434\u044b <a href=\"https:\/\/docs.mongodb.org\/manual\/reference\/command\/collMod\/#dbcmd.collMod\">collMod<\/a> \u0434\u043b\u044f \u0443\u0436\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u0439 \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u0438. \u041e\u043f\u0446\u0438\u044f <code>validator<\/code> \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0451\u043d\u043d\u044b\u043c \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f\u043c, \u0437\u0430 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435\u043c <code>$geoNear<\/code>, <code>$near<\/code>, <code>$nearSphere<\/code>, <code>$text<\/code> \u0438 <code>$where<\/code>.<\/p>\n<p>  \u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u043f\u0440\u0438\u043c\u0435\u0440 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u0438 \u043f\u0440\u0438 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0438 \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u0438 <code>contacts<\/code>:  <\/p>\n<pre><code class=\"python\">db.createCollection( &quot;contacts&quot;,    { validator: { $or:       [          { phone: { $type: &quot;string&quot; } },          { email: { $regex: \/@mongodb\\.com$\/ } },          { status: { $in: [ &quot;Unknown&quot;, &quot;Incomplete&quot; ] } }       ]    } } ) <\/code><\/pre>\n<p>  <code>MongoDB<\/code> \u0442\u0430\u043a\u0436\u0435 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u043e\u043f\u0446\u0438\u044e <code>validationLevel<\/code>, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442, \u043d\u0430\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0441\u0442\u0440\u043e\u0433\u043e <code>MongoDB<\/code> \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0435\u0442 \u043f\u0440\u0430\u0432\u0438\u043b\u0430 \u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u0438, \u0434\u043b\u044f \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0445 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u043e\u0432 \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u0438\u0445 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f, \u0438 \u043e\u043f\u0446\u0438\u044f <code>validationAction<\/code>, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442, \u0434\u043e\u043b\u0436\u0435\u043d \u043b\u0438 mongodb \u043e\u0442\u043a\u043b\u043e\u043d\u0438\u0442\u044c \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0430\u0440\u0443\u0448\u0430\u044e\u0442 \u043f\u0440\u0430\u0432\u0438\u043b\u0430 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438.<\/p>\n<h4>\u041f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435<\/h4>\n<p>  \u0412\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u044f \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f \u0438 \u0432\u0441\u0442\u0430\u0432\u043a\u0438 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u043e\u0432. \u041f\u0440\u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0438 \u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u0438 \u0432 \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u044e, \u0443\u0436\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0435 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u044b \u043e\u0441\u0442\u0430\u044e\u0442\u0441\u044f \u043d\u0435 \u043c\u043e\u0434\u0438\u0444\u0438\u0446\u0438\u0440\u0443\u044e\u0442\u0441\u044f. <\/p>\n<h4>\u0421\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0435 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u044b<\/h4>\n<p>  \u041c\u043e\u0436\u043d\u043e \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043a\u0430\u043a <code>mongodb<\/code> \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u0442 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0435 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u043e\u043f\u0446\u0438\u044e <code>validationLevel<\/code>. <br \/>  \u041f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e, <code>validationLevel<\/code> \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f <code>strict<\/code>, \u0438 <code>mongodb<\/code> \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0435\u0442 \u043f\u0440\u0430\u0432\u0438\u043b\u0430 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u0434\u043b\u044f \u0432\u0441\u0435\u0445 \u0432\u0441\u0442\u0430\u0432\u043e\u043a \u0438 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0439. \u0415\u0441\u043b\u0438 <code>validationLevel<\/code> \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d \u043a\u0430\u043a <code>moderate<\/code>, \u0442\u043e \u0442\u043e\u0433\u0434\u0430 \u043f\u0440\u0430\u0432\u0438\u043b\u0430 \u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u0438 \u043f\u0440\u0438 \u0432\u0441\u0442\u0430\u0432\u043a\u0435 \u0438 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0438 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u043e\u0432, \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u044e\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u043a \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u043c, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0442 \u043a\u0440\u0438\u0442\u0435\u0440\u0438\u044f\u043c \u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u0438.<\/p>\n<p>  \u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u044b \u0432 \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u0438 <code>contacts<\/code>:  <\/p>\n<pre><code class=\"python\">{    &quot;_id&quot;: &quot;125876&quot;    &quot;name&quot;: &quot;Anne&quot;,    &quot;phone&quot;: &quot;+1 555 123 456&quot;,    &quot;city&quot;: &quot;London&quot;,    &quot;status&quot;: &quot;Complete&quot; }, {    &quot;_id&quot;: &quot;860000&quot;,    &quot;name&quot;: &quot;Ivan&quot;,    &quot;city&quot;: &quot;Vancouver&quot; } <\/code><\/pre>\n<p>  \u0412\u044b\u043f\u043e\u043b\u043d\u0438\u043c \u043a\u043e\u043c\u0430\u043d\u0434\u0443, \u0447\u0442\u043e\u0431\u044b \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u044e \u0432 \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u044e <code>contacts<\/code>:  <\/p>\n<pre><code class=\"python\">db.runCommand( {    collMod: &quot;contacts&quot;,    validator: { $or: [ { phone: { $exists: true } }, { email: { $exists: true } } ] },    validationLevel: &quot;moderate&quot; } ) <\/code><\/pre>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u0432 \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u0438 <code>contacts<\/code> \u0435\u0441\u0442\u044c \u0432\u0430\u043b\u0438\u0434\u0430\u0442\u043e\u0440. \u0418 \u0442\u0435\u043f\u0435\u0440\u044c \u0435\u0441\u043b\u0438 \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u0442\u044c \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442 \u0441 <code>{_id: 125876}<\/code>, <code>mongodb<\/code> \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0442\u044c \u043f\u0440\u0430\u0432\u0438\u043b\u0430 \u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u0438, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0439 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u043a\u0440\u0438\u0442\u0435\u0440\u0438\u044f\u043c. \u0410 \u0434\u043b\u044f \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430 <code>{ _id:860000 }<\/code>, mongodb \u043d\u0435 \u043f\u0440\u0438\u043c\u0435\u043d\u0438\u0442 \u043f\u0440\u0430\u0432\u0438\u043b\u0430 \u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u0438 \u043d\u0430 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f, \u0442\u0430\u043a \u043a\u0430\u043a \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442 \u043d\u0435 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u043f\u0440\u0430\u0432\u0438\u043b\u0443 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438.<br \/>  \u0415\u0441\u043b\u0438 \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u043e\u0442\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u044e, \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u043e\u043f\u0446\u0438\u044e <code>validationLevel<\/code> \u043a\u0430\u043a <code>off<\/code>.  <\/p>\n<h4>\u041f\u0440\u0438\u043d\u044f\u0442\u044c \u0438\u043b\u0438 \u043e\u0442\u043a\u043b\u043e\u043d\u0438\u0442\u044c \u0431\u0440\u0430\u043a\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u044b<\/p>\n<h4>\u0412 \u043e\u043f\u0446\u0438\u0438 <code>validationAction<\/code>, \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442\u0441\u044f \u043a\u0430\u043a \u043f\u043e\u0441\u0442\u0443\u043f\u0438\u0442\u044c \u0441 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u043c\u0438 \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0430\u0440\u0443\u0448\u0438\u043b\u0438 \u043f\u0440\u0430\u0432\u0438\u043b\u0430 \u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u0438. <br \/>  \u041f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e <code>validationAction<\/code>, \u0432\u044b\u0441\u0442\u0430\u0432\u043b\u0435\u043d \u043a\u0430\u043a <code>error<\/code> \u0438 <code>MongoDB<\/code> \u043e\u0442\u043a\u043b\u043e\u043d\u044f\u0435\u0442 \u043b\u044e\u0431\u044b\u0435 \u0432\u0441\u0442\u0430\u0432\u043a\u0438 \u0438 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u043e\u0432, \u0435\u0441\u043b\u0438 \u0435\u0441\u0442\u044c \u043d\u0430\u0440\u0443\u0448\u0435\u043d\u0438\u0435 \u043f\u0440\u0430\u0432\u0438\u043b\u0430 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438. \u041a\u043e\u0433\u0434\u0430 <code>validationAction<\/code> \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d \u043a\u0430\u043a <code>warn<\/code>, <code>MongoDB<\/code> \u0436\u0443\u0440\u043d\u0430\u043b\u0438\u0440\u0443\u0435\u0442 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u044b, \u043d\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u0432\u0441\u0442\u0430\u0432\u043a\u0438 \u0438 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f.<\/p>\n<p>  \u0412 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u0441\u043e\u0437\u0434\u0430\u0435\u0442\u0441\u044f \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u044f <code>contacts<\/code> \u0441 \u0432\u0430\u043b\u0438\u0434\u0430\u0442\u043e\u0440\u043e\u043c, \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u044e\u0449\u0438\u043c, \u0447\u0442\u043e \u0432\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u043d\u044b\u0435 \u0438\u043b\u0438 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u044b\u0435 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u044b \u0434\u043e\u043b\u0436\u043d\u044b \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c \u043f\u043e \u043a\u0440\u0430\u0439\u043d\u0435\u0439 \u043c\u0435\u0440\u0435 \u043e\u0434\u043d\u043e\u043c\u0443 \u0438\u0437 \u0442\u0440\u0435\u0445 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0445 \u0443\u0441\u043b\u043e\u0432\u0438\u0439:  <\/p>\n<ul>\n<li>\u043f\u043e\u043b\u0435 <code>phone<\/code> \u0434\u043e\u043b\u0436\u043d\u043e \u0431\u044b\u0442\u044c \u0441\u0442\u0440\u043e\u043a\u043e\u0439<\/li>\n<li>\u043f\u043e\u043b\u0435 <code>email<\/code> \u0434\u043e\u043b\u0436\u043d\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0442\u0441\u044f \u0440\u0435\u0433\u0443\u043b\u044f\u0440\u043d\u044b\u043c \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0435\u043c \u043d\u0430 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0435 <\/li>\n<li>\u043f\u043e\u043b\u0435 <code>status<\/code> \u0434\u043e\u043b\u0436\u043d\u043e \u0431\u044b\u0442\u044c \u043b\u0438\u0431\u043e Unknown \u043b\u0438\u0431\u043e Incomplete.<\/li>\n<\/ul>\n<p>  <\/p>\n<pre><code class=\"python\">db.createCollection( &quot;contacts&quot;,    {       validator: { $or:          [             { phone: { $type: &quot;string&quot; } },             { email: { $regex: \/@mongodb\\.com$\/ } },             { status: { $in: [ &quot;Unknown&quot;, &quot;Incomplete&quot; ] } }          ],        validationAction: &quot;warn&quot;       }    } ) <\/code><\/pre>\n<p>  \u0421\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u0438\u043d\u0441\u0435\u0440\u0442 \u0434\u043e\u043b\u0436\u0435\u043d \u043f\u0440\u0438\u0432\u0435\u0441\u0442\u0438 \u043a \u0441\u0431\u043e\u044e, \u043d\u043e, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443, \u043f\u0440\u0430\u0432\u0438\u043b\u043e \u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u0438 <code>validationAction&lt;code&gt; \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043e \u043a\u0430\u043a &lt;code&gt;warn<\/code>, \u0442\u043e \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044f \u0437\u0430\u043f\u0438\u0441\u0438 \u0437\u0430\u043f\u0438\u0448\u0435\u0442 \u0432 \u0436\u0443\u0440\u043d\u0430\u043b \u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u0441\u044f \u0443\u0441\u043f\u0435\u0448\u043d\u043e.  <\/p>\n<pre><code class=\"python\">2015-10-15T11:20:44.260-0400 W STORAGE  [conn3] Document would fail validation collection: example.contacts doc: { _id: ObjectId('561fc44c067a5d85b96274e4'), name: &quot;Amanda&quot;, status: &quot;Updated&quot; } <\/code><\/pre>\n<p>  <\/p>\n<h4>\u041e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u044f<\/h4>\n<p>  \u041d\u0435\u043b\u044c\u0437\u044f \u043d\u0430\u0437\u043d\u0430\u0447\u0430\u0442\u044c \u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u044e \u0434\u043b\u044f \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u0439 <code>admin<\/code>, <code>local<\/code>. <br \/>  \u0418 \u043d\u0435\u043b\u044c\u0437\u044f \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u0432\u0430\u043b\u0438\u0434\u0430\u0442\u043e\u0440 \u0434\u043b\u044f \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u0439 <code>system.*<\/code><\/p>\n<h3><a name=\"2\"><\/a><font color=\"orange\"> \u041d\u043e\u0432\u043e\u0432\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u0430\u0433\u0440\u0435\u0433\u0430\u0446\u0438\u043e\u043d\u043d\u043e\u0433\u043e \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0430 \u0438 INNER JOIN<\/font><\/h3>\n<p>  <code>$lookup<\/code> \u2014 \u0441\u0432\u044f\u0437\u044b\u0432\u0430\u043d\u0438\u0435 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u0439.<br \/>  \u0425\u043e\u0442\u044c \u044d\u0442\u043e\u0442 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440 \u0438 \u043d\u0430\u0437\u0432\u0430\u043b\u0438 \u0441\u0432\u043e\u0439 <code>inner join<\/code> \u0434\u043b\u044f <code>mongodb<\/code> \u043c\u043d\u0435 \u0432\u0441\u0435-\u0442\u0430\u043a\u0438 \u043a\u0430\u0436\u0435\u0442\u0441\u044f, \u0447\u0442\u043e \u044d\u0442\u043e\u0442 \u0432\u043e\u043f\u0440\u043e\u0441 \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0448\u0438\u0440\u0435, \u0438 \u0435\u0433\u043e \u043d\u0430\u0434\u043e \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0442\u044c \u0432 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0435 \u0441\u0432\u044f\u0437\u044b\u0432\u0430\u043d\u0438\u044f \u0440\u0430\u0437\u043d\u044b\u0445 \u0442\u0438\u043f\u043e\u0432 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u043e\u0432, \u0430 \u043d\u0435 \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u0439. \u042f \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u043b \u044d\u0442\u043e\u0442 \u0432\u043e\u043f\u0440\u043e\u0441 \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e <a href=\"http:\/\/habrahabr.ru\/post\/259219\/#6\">\u0442\u0443\u0442<\/a>.<br \/>  \u0421\u0430\u043c <code>$lookup<\/code> \u0438\u043c\u0435\u0435\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441:  <\/p>\n<pre><code class=\"python\">{    $lookup:      {        from: &lt;\u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u044f \u0434\u043b\u044f \u0441\u0432\u044f\u0437\u044b\u0432\u0430\u043d\u0438\u044f&gt;,        localField: &lt;\u043f\u043e\u043b\u0435 \u0438\u0437 \u0432\u0445\u043e\u0434\u044f\u0449\u0438\u0439 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u043e\u0432&gt;,        foreignField: &lt;\u043f\u043e\u043b\u0435 \u0438\u0437 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u043e\u0432 \u0438\u0437 \u0434\u0440\u0443\u0433\u043e\u0439 \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u0438&gt;,        as: &lt;\u0438\u0441\u0445\u043e\u0434\u044f\u0449\u0438\u0439 \u043c\u0430\u0441\u0441\u0438\u0432&gt;      } } <\/code><\/pre>\n<p>  \u0412 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u0434\u0432\u0435 \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u0438:<br \/>  \u041a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u044f <code>orders<\/code> \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043d\u0430\u0445\u043e\u0434\u044f\u0442\u0441\u044f \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u044b:  <\/p>\n<pre><code class=\"python\">{ &quot;_id&quot; : 1, &quot;item&quot; : &quot;abc&quot;, &quot;price&quot; : 12, &quot;quantity&quot; : 2 } { &quot;_id&quot; : 2, &quot;item&quot; : &quot;jkl&quot;, &quot;price&quot; : 20, &quot;quantity&quot; : 1 } { &quot;_id&quot; : 3  } <\/code><\/pre>\n<p>  \u0418 \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u044f <code>inventory<\/code> \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0449\u0430\u044f \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u044b:  <\/p>\n<pre><code class=\"python\">{ &quot;_id&quot; : 1, &quot;sku&quot; : &quot;abc&quot;, description: &quot;product 1&quot;, &quot;instock&quot; : 120 } { &quot;_id&quot; : 2, &quot;sku&quot; : &quot;def&quot;, description: &quot;product 2&quot;, &quot;instock&quot; : 80 } { &quot;_id&quot; : 3, &quot;sku&quot; : &quot;ijk&quot;, description: &quot;product 3&quot;, &quot;instock&quot; : 60 } { &quot;_id&quot; : 4, &quot;sku&quot; : &quot;jkl&quot;, description: &quot;product 4&quot;, &quot;instock&quot; : 70 } { &quot;_id&quot; : 5, &quot;sku&quot;: null, description: &quot;Incomplete&quot; } { &quot;_id&quot; : 6 } <\/code><\/pre>\n<p>  \u0421\u043b\u0435\u0434\u0443\u044e\u0449\u0430\u044f \u0430\u0433\u0440\u0435\u0433\u0430\u0446\u0438\u043e\u043d\u043d\u0430\u044f \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044f, \u0434\u043b\u044f \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u0438 <code>orders<\/code>, \u0441\u0432\u044f\u0436\u0435\u0442 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u044b \u0438\u0437 <code>orders<\/code>, \u0441 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u043c\u0438 \u0438\u0437 \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u0438 <code>inventory<\/code>, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u043f\u043e\u043b\u0435 <code>item<\/code> \u0438\u0437 <code>orders<\/code> \u0438 \u043f\u043e\u043b\u0435 <code>sku<\/code> \u0438\u0437 <code>inventory<\/code>:  <\/p>\n<pre><code class=\"python\">db.orders.aggregate([     {       $lookup:         {           from: &quot;inventory&quot;,           localField: &quot;item&quot;,           foreignField: &quot;sku&quot;,           as: &quot;inventory_docs&quot;         }    } ]) <\/code><\/pre>\n<p>  \u041d\u0430 \u0432\u044b\u0445\u043e\u0434\u0435 \u044d\u0442\u0430 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044f \u0432\u043e\u0437\u0432\u0440\u0430\u0442\u0438\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u044b:  <\/p>\n<pre><code class=\"python\">{   &quot;_id&quot; : 1,    &quot;item&quot; : &quot;abc&quot;,   &quot;price&quot; : 12,   &quot;quantity&quot; : 2,   &quot;inventory_docs&quot; : [     { &quot;_id&quot; : 1, &quot;sku&quot; : &quot;abc&quot;, description: &quot;product 1&quot;, &quot;instock&quot; : 120 }   ] } {   &quot;_id&quot; : 2,   &quot;item&quot; : &quot;jkl&quot;,   &quot;price&quot; : 20,   &quot;quantity&quot; : 1,   &quot;inventory_docs&quot; : [     { &quot;_id&quot; : 4, &quot;sku&quot; : &quot;jkl&quot;, &quot;description&quot; : &quot;product 4&quot;, &quot;instock&quot; : 70 }   ] } {   &quot;_id&quot; : 3,   &quot;inventory_docs&quot; : [     { &quot;_id&quot; : 5, &quot;sku&quot; : null, &quot;description&quot; : &quot;Incomplete&quot; },     { &quot;_id&quot; : 6 }   ] } <\/code><\/pre>\n<p>  <code>$sample<\/code> \u2014 \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u044b\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u0432\u044b\u0431\u0438\u0440\u0430\u0435\u0442 \u0437\u0430\u0434\u0430\u043d\u043d\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u043e\u0432 \u0438\u0437 \u0432\u0445\u043e\u0434\u043d\u043e\u0433\u043e \u043f\u043e\u0442\u043e\u043a\u0430.<br \/>  \u0421\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441:  <\/p>\n<pre><code class=\"python\">{ $sample: { size: &lt;positive integer&gt; } } <\/code><\/pre>\n<p>  \u0412 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u044f <code>users<\/code>, \u0441\u043e\u0441\u0442\u043e\u044f\u0449\u0430\u044f \u0438\u0437 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0445 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u043e\u0432:  <\/p>\n<pre><code class=\"python\">{ &quot;_id&quot; : 1, &quot;name&quot; : &quot;dave123&quot;, &quot;q1&quot; : true, &quot;q2&quot; : true } { &quot;_id&quot; : 2, &quot;name&quot; : &quot;dave2&quot;, &quot;q1&quot; : false, &quot;q2&quot; : false  } { &quot;_id&quot; : 3, &quot;name&quot; : &quot;ahn&quot;, &quot;q1&quot; : true, &quot;q2&quot; : true  } { &quot;_id&quot; : 4, &quot;name&quot; : &quot;li&quot;, &quot;q1&quot; : true, &quot;q2&quot; : false  } { &quot;_id&quot; : 5, &quot;name&quot; : &quot;annT&quot;, &quot;q1&quot; : false, &quot;q2&quot; : true  } { &quot;_id&quot; : 6, &quot;name&quot; : &quot;li&quot;, &quot;q1&quot; : true, &quot;q2&quot; : true  } { &quot;_id&quot; : 7, &quot;name&quot; : &quot;ty&quot;, &quot;q1&quot; : false, &quot;q2&quot; : true  } <\/code><\/pre>\n<p>  \u0410\u0433\u0440\u0435\u0433\u0430\u0446\u0438\u043e\u043d\u043d\u0430\u044f \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044f \u0432\u044b\u0431\u0435\u0440\u0435\u0442 \u0432 \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u043e\u043c \u043f\u043e\u0440\u044f\u0434\u043a\u0435 \u0442\u0440\u0438 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430 \u0438\u0437 \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u0438:  <\/p>\n<pre><code class=\"python\">db.users.aggregate(    [ { $sample: { size: 3 } } ] ) <\/code><\/pre>\n<p>  \u0412 <code>PostgreSQL 9.5<\/code>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u043e\u0442-\u0432\u043e\u0442 \u0434\u043e\u043b\u0436\u0435\u043d \u0432\u044b\u0439\u0442\u0438, \u0442\u043e\u0436\u0435 \u043f\u043e\u044f\u0432\u0438\u043b\u0430\u0441\u044c \u043f\u043e\u0445\u043e\u0436\u0430\u044f \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c. <\/p>\n<p>  <code>$indexStats<\/code> \u2014 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0443 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0438\u043d\u0434\u0435\u043a\u0441\u0430.<br \/>  \u0412\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0443 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0438\u043d\u0434\u0435\u043a\u0441\u0430 \u0434\u043b\u044f \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u0438. \u0415\u0441\u043b\u0438 \u0437\u0430\u043f\u0443\u0449\u0435\u043d\u0430 \u0441 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u0435\u043c \u0434\u043e\u0441\u0442\u0443\u043f\u0430, \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0434\u043e\u043b\u0436\u0435\u043d \u0438\u043c\u0435\u0442\u044c \u043f\u0440\u0438\u0432\u0438\u043b\u0435\u0433\u0438\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0432\u043a\u043b\u044e\u0447\u0430\u044e\u0442 <code>indexStats<\/code>.<\/p>\n<p>  \u0421\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441:  <\/p>\n<pre><code class=\"python\">{ $indexStats: { } } <\/code><\/pre>\n<p>  \u0414\u043b\u044f \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u0432\u043e\u0437\u044c\u043c\u0435\u043c \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u044e <code>orders<\/code>, \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0449\u0443\u044e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u044b:  <\/p>\n<pre><code class=\"python\">{ &quot;_id&quot; : 1, &quot;item&quot; : &quot;abc&quot;, &quot;price&quot; : 12, &quot;quantity&quot; : 2, &quot;type&quot;: &quot;apparel&quot; } { &quot;_id&quot; : 2, &quot;item&quot; : &quot;jkl&quot;, &quot;price&quot; : 20, &quot;quantity&quot; : 1, &quot;type&quot;: &quot;electronics&quot; } { &quot;_id&quot; : 3, &quot;item&quot; : &quot;abc&quot;, &quot;price&quot; : 10, &quot;quantity&quot; : 5, &quot;type&quot;: &quot;apparel&quot; } <\/code><\/pre>\n<p>  \u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043d\u0430 \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u0438 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0434\u0432\u0430 \u0438\u043d\u0434\u0435\u043a\u0441\u0430:  <\/p>\n<pre><code class=\"python\">db.orders.createIndex( { item: 1, quantity: 1 } ) db.orders.createIndex( { type: 1, item: 1 } ) <\/code><\/pre>\n<p>  \u0412\u044b\u043f\u043e\u043b\u043d\u0438\u043c \u043a\u0430\u043a\u0438\u0435-\u0442\u043e \u0437\u0430\u043f\u0440\u043e\u0441\u044b:   <\/p>\n<pre><code class=\"python\">db.orders.find( { type: &quot;apparel&quot;} ) db.orders.find( { item: &quot;abc&quot; } ).sort( { quantity: 1 } ) <\/code><\/pre>\n<p>  \u0414\u043b\u044f \u043f\u0440\u043e\u0441\u043c\u043e\u0442\u0440\u0430 \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0438 \u043f\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044e \u0438\u043d\u0434\u0435\u043a\u0441\u0430 \u0434\u043b\u044f \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u0438 <code>orders<\/code> \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0443\u044e \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044e:  <\/p>\n<pre><code class=\"python\">db.orders.aggregate( [ { $indexStats: { } } ] ) <\/code><\/pre>\n<p>  \u041e\u043f\u0435\u0440\u0430\u0446\u0438\u044f \u0432\u043e\u0437\u0432\u0440\u0430\u0442\u0438\u0442 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u044b, \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0449\u0438\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0438 \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0438\u043d\u0434\u0435\u043a\u0441\u0430:  <\/p>\n<pre><code class=\"python\">{    &quot;name&quot; : &quot;item_1_quantity_1&quot;,    &quot;key&quot; : { &quot;item&quot; : 1,  &quot;quantity&quot; : 1 },    &quot;host&quot; : &quot;examplehost.local:27017&quot;,    &quot;accesses&quot; : {       &quot;ops&quot; : NumberLong(1),       &quot;since&quot; : ISODate(&quot;2015-10-02T14:31:53.685Z&quot;)    } } {    &quot;name&quot; : &quot;_id_&quot;,    &quot;key&quot; : { &quot;_id&quot; : 1  },    &quot;host&quot; : &quot;examplehost.local:27017&quot;,    &quot;accesses&quot; : {       &quot;ops&quot; : NumberLong(0),       &quot;since&quot; : ISODate(&quot;2015-10-02T14:31:32.479Z&quot;)    } } {    &quot;name&quot; : &quot;type_1_item_1&quot;,    &quot;key&quot; : {  &quot;type&quot; : 1, &quot;item&quot; : 1 },    &quot;host&quot; : &quot;examplehost.local:27017&quot;,    &quot;accesses&quot; : {       &quot;ops&quot; : NumberLong(1),       &quot;since&quot; : ISODate(&quot;2015-10-02T14:31:58.321Z&quot;)    } } <\/code><\/pre>\n<p>  <code>$stdDevSamp<\/code> \u2014 \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u0435\u0442 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u0435 \u043e\u0442\u043a\u043b\u043e\u043d\u0435\u043d\u0438\u0435 \u0432\u044b\u0431\u043e\u0440\u043a\u0438 \u0432\u0445\u043e\u0434\u043d\u044b\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439.<br \/>  \u0414\u043e\u0441\u0442\u0443\u043f\u0435\u043d \u0438\u0437 <code>$group<\/code> \u0438 <code>$project<\/code>, \u0438\u0433\u043d\u043e\u0440\u0438\u0440\u0443\u0435\u0442 \u043d\u0435 \u0446\u0438\u0444\u0440\u043e\u0432\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0438, \u0435\u0441\u043b\u0438 \u0442\u0430\u043a\u043e\u0435 \u043f\u0435\u0440\u0435\u0434\u0430\u043d\u043e, \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 <code>null<\/code>.<br \/>  \u0414\u043b\u044f \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u0432\u043e\u0437\u044c\u043c\u0435\u043c \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u044e <code>users<\/code>:  <\/p>\n<pre><code class=\"python\">{_id: 0, username: &quot;user0&quot;, age: 20} {_id: 1, username: &quot;user1&quot;, age: 42} {_id: 2, username: &quot;user2&quot;, age: 28} <\/code><\/pre>\n<p>  \u0427\u0442\u043e\u0431\u044b \u0440\u0430\u0441\u0441\u0447\u0438\u0442\u0430\u0442\u044c \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u0435 \u043e\u0442\u043a\u043b\u043e\u043d\u0435\u043d\u0438\u0435 \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u043e\u0439 \u0432\u044b\u0431\u043e\u0440\u043a\u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439, \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440 <code>$sample<\/code> \u0434\u043b\u044f \u0432\u044b\u0431\u043e\u0440\u043a\u0438 100 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439, \u0438 \u0442\u043e\u0433\u0434\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c <code>$stdDevSamp<\/code> \u0434\u043b\u044f \u043a\u0430\u043b\u044c\u043a\u0443\u043b\u044f\u0446\u0438\u0438.  <\/p>\n<pre><code class=\"python\">db.users.aggregate(    [       { $sample: { size: 100 } },       { $group: { _id: null, ageStdDev: { $stdDevSamp: &quot;$age&quot; } } }    ] ) <\/code><\/pre>\n<p>  \u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442:  <\/p>\n<pre><code class=\"python\">{ &quot;_id&quot; : null, &quot;ageStdDev&quot; : 7.811258386185771 } <\/code><\/pre>\n<h4>\u041d\u043e\u0432\u044b\u0435 \u0430\u0433\u0440\u0435\u0433\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0435 \u0430\u0440\u0438\u0444\u043c\u0435\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u044b<\/h4>\n<p>  <code>$sqrt<\/code> \u2014 \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u0435\u0442 \u043a\u0432\u0430\u0434\u0440\u0430\u0442\u043d\u044b\u0439 \u043a\u043e\u0440\u0435\u043d\u044c.<br \/>  \u0421\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441  <\/p>\n<pre><code class=\"python\">{ $sqrt: &lt;number&gt; } <\/code><\/pre>\n<p>  \u041f\u0440\u043e\u0441\u0442\u044b\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u044b:  <\/p>\n<pre><code class=\"python\">{ $sqrt: 25 }\t5 { $sqrt: 30 }\t5.477225575051661 { $sqrt: null }\tnull <\/code><\/pre>\n<p>  \u0415\u0441\u0442\u044c \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u044f <code>points<\/code> \u0441 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u043c\u0438:  <\/p>\n<pre><code class=\"python\">{ _id: 1, p1: { x: 5, y: 8 }, p2: { x: 0, y: 5} } { _id: 2, p1: { x: -2, y: 1 }, p2: { x: 1, y: 5} } { _id: 3, p1: { x: 4, y: 4 }, p2: { x: 4, y: 0} } <\/code><\/pre>\n<p>  \u0421\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u043f\u0440\u0438\u043c\u0435\u0440, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 <code>$sqrt<\/code>, \u0434\u043b\u044f \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f \u0440\u0430\u0441\u0441\u0442\u043e\u044f\u043d\u0438\u044f \u043c\u0435\u0436\u0434\u0443 <code>p1<\/code> \u0438 <code>p2<\/code>:  <\/p>\n<pre><code class=\"python\">db.points.aggregate([    {      $project: {         distance: {            $sqrt: {                $add: [                   { $pow: [ { $subtract: [ &quot;$p2.y&quot;, &quot;$p1.y&quot; ] }, 2 ] },                   { $pow: [ { $subtract: [ &quot;$p2.x&quot;, &quot;$p1.x&quot; ] }, 2 ] }                ]            }         }      }    } ]) <\/code><\/pre>\n<p>  \u041d\u0430 \u0432\u044b\u0445\u043e\u0434\u0435 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442:  <\/p>\n<pre><code class=\"python\">{ &quot;_id&quot; : 1, &quot;distance&quot; : 5.830951894845301 } { &quot;_id&quot; : 2, &quot;distance&quot; : 5 } { &quot;_id&quot; : 3, &quot;distance&quot; : 4 } <\/code><\/pre>\n<p>  <code>$abs<\/code> \u2014 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0430\u0431\u0441\u043e\u043b\u044e\u0442\u043d\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0447\u0438\u0441\u043b\u0430.<br \/>  \u0421\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441  <\/p>\n<pre><code class=\"python\">{ $abs: &lt;number&gt; } <\/code><\/pre>\n<p>  \u041f\u0440\u043e\u0441\u0442\u043e\u0439 \u043f\u0440\u0438\u043c\u0435\u0440:  <\/p>\n<pre><code class=\"python\">{ $abs: -1 }\t1 { $abs: 1 }\t1 { $abs: null }\tnull <\/code><\/pre>\n<p>  \u0412 \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u0438 <code>ratings<\/code> \u0435\u0441\u0442\u044c \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u044b:  <\/p>\n<pre><code class=\"python\">{ _id: 1, start: 5, end: 8 } { _id: 2, start: 4, end: 4 } { _id: 3, start: 9, end: 7 } { _id: 4, start: 6, end: 7 } <\/code><\/pre>\n<p>  \u0412 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u0435\u0442\u0441\u044f \u0432\u0435\u043b\u0438\u0447\u0438\u043d\u0430 \u0440\u0430\u0437\u043d\u043e\u0441\u0442\u0438 \u043c\u0435\u0436\u0434\u0443 \u043d\u0430\u0447\u0430\u043b\u044c\u043d\u044b\u043c \u0438 \u043a\u043e\u043d\u0435\u0447\u043d\u044b\u043c \u0440\u0435\u0439\u0442\u0438\u043d\u0433\u0430\u043c\u0438:  <\/p>\n<pre><code class=\"python\">db.ratings.aggregate([    {      $project: { delta: { $abs: { $subtract: [ &quot;$start&quot;, &quot;$end&quot; ] } } }    } ]) <\/code><\/pre>\n<p>  \u041d\u0430 \u0432\u044b\u0445\u043e\u0434\u0435:  <\/p>\n<pre><code class=\"python\">{ &quot;_id&quot; : 1, &quot;delta&quot; : 3 } { &quot;_id&quot; : 2, &quot;delta&quot; : 0 } { &quot;_id&quot; : 3, &quot;delta&quot; : 2 } { &quot;_id&quot; : 4, &quot;delta&quot; : 1 } <\/code><\/pre>\n<p>  <code>$log<\/code> \u2014 \u0440\u0430\u0441\u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u0442 \u043b\u043e\u0433\u0430\u0440\u0438\u0444\u043c.<br \/>  \u0421\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441  <\/p>\n<pre><code class=\"python\">{ $log: [ &lt;number&gt;, &lt;base&gt; ] } <\/code><\/pre>\n<p>  \u0420\u0430\u0441\u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u0442 \u043b\u043e\u0433\u0430\u0440\u0438\u0444\u043c \u0447\u0438\u0441\u043b\u0430, \u0438 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0432 \u0432\u0438\u0434\u0435 \u0434\u0440\u043e\u0431\u0438.<br \/>  \u0415\u0441\u0442\u044c \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u044f <code>examples<\/code>:   <\/p>\n<pre><code class=\"python\">{ _id: 1, positiveInt: 5 } { _id: 2, positiveInt: 2 } { _id: 3, positiveInt: 23 } { _id: 4, positiveInt: 10 } <\/code><\/pre>\n<p>  \u0412 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f <code>log2<\/code>, \u0447\u0442\u043e\u0431\u044b \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u0447\u0438\u0441\u043b\u043e \u0431\u0438\u0442\u043e\u0432, \u0442\u0440\u0435\u0431\u0443\u0435\u043c\u044b\u0445 \u0434\u043b\u044f \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f <\/h4>\n<p>positiveInt<code>. \u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442: &lt;source lang=&quot;python&quot;&gt; { &quot;_id&quot; : 1, &quot;bitsNeeded&quot; : 3 } { &quot;_id&quot; : 2, &quot;bitsNeeded&quot; : 2 } { &quot;_id&quot; : 3, &quot;bitsNeeded&quot; : 5 } { &quot;_id&quot; : 4, &quot;bitsNeeded&quot; : 4 } &lt;\/source&gt; &lt;code&gt;$ln<\/code> \u2014 \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u0435\u0442 \u043d\u0430\u0442\u0443\u0440\u0430\u043b\u044c\u043d\u044b\u0439 \u043b\u043e\u0433\u0430\u0440\u0438\u0444\u043c \u0447\u0438\u0441\u043b\u0430. <br \/>  \u0421\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441  <\/p>\n<pre><code class=\"python\">{ $ln: &lt;number&gt; } <\/code><\/pre>\n<p>  <\/p>\n<pre><code class=\"python\">{ _id: 1, year: &quot;2000&quot;, sales: 8700000 } { _id: 2, year: &quot;2005&quot;, sales: 5000000 } { _id: 3, year: &quot;2010&quot;, sales: 6250000 } <\/code><\/pre>\n<p>  \u0412 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435, \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u0443\u044e\u0442\u0441\u044f \u0434\u0430\u043d\u043d\u044b\u0435 \u043e \u043f\u0440\u043e\u0434\u0430\u0436\u0430\u0445:  <\/p>\n<pre><code class=\"python\">db.sales.aggregate( [ { $project: { x: &quot;$year&quot;, y: { $ln: &quot;$sales&quot;  } } } ] ) <\/code><\/pre>\n<p>  \u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442:  <\/p>\n<pre><code class=\"python\">{ &quot;_id&quot; : 1, &quot;x&quot; : &quot;2000&quot;, &quot;y&quot; : 15.978833583624812 } { &quot;_id&quot; : 2, &quot;x&quot; : &quot;2005&quot;, &quot;y&quot; : 15.424948470398375 } { &quot;_id&quot; : 3, &quot;x&quot; : &quot;2010&quot;, &quot;y&quot; : 15.648092021712584 } <\/code><\/pre>\n<p>  <code>$pow<\/code> \u2014 \u0432\u043e\u0437\u0432\u043e\u0434\u0438\u0442 \u0447\u0438\u0441\u043b\u043e \u0432 \u0437\u0430\u0434\u0430\u043d\u043d\u0443\u044e \u044d\u043a\u0441\u043f\u043e\u043d\u0435\u043d\u0442\u0443 (\u0432\u043e\u0437\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u0432 \u0441\u0442\u0435\u043f\u0435\u043d\u044c). <br \/>  \u0421\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441:  <\/p>\n<pre><code class=\"python\">{ $pow: [ &lt;number&gt;, &lt;exponent&gt; ] } <\/code><\/pre>\n<p>\u041f\u0440\u0438\u043c\u0435\u0440\u044b:  <\/p>\n<pre><code class=\"python\">{ $pow: [ 5, 0 ] }\t1 { $pow: [ 5, 2 ] }\t25 { $pow: [ 5, -2 ] }\t0.04 <\/code><\/pre>\n<p>  <\/p>\n<pre><code class=\"python\">{    &quot;_id&quot; : 1,    &quot;scores&quot; : [       { &quot;name&quot; : &quot;dave123&quot;,  &quot;score&quot; : 85  },       {  &quot;name&quot; : &quot;dave2&quot;,   &quot;score&quot; : 90 },       {  &quot;name&quot; : &quot;ahn&quot;,    &quot;score&quot; : 71    }    ] } {    &quot;_id&quot; : 2,    &quot;scores&quot; : [       {  &quot;name&quot; : &quot;li&quot;,  &quot;quiz&quot; : 2,   &quot;score&quot; : 96   },       { &quot;name&quot; : &quot;annT&quot;,  &quot;score&quot; : 77  },       { &quot;name&quot; : &quot;ty&quot;, &quot;score&quot; : 82 }    ] } <\/code><\/pre>\n<p>  \u0421\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u043f\u0440\u0438\u043c\u0435\u0440, \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u0435\u0442 \u0440\u0430\u0441\u0445\u043e\u0436\u0434\u0435\u043d\u0438\u044f \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u043e\u043f\u0440\u043e\u0441\u0430:  <\/p>\n<pre><code class=\"python\">db.quizzes.aggregate([    { $project: { variance: { $pow: [ { $stdDevPop: &quot;$scores.score&quot; }, 2 ] } } } ]) <\/code><\/pre>\n<p>  \u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442:  <\/p>\n<pre><code class=\"python\">{ &quot;_id&quot; : 1, &quot;variance&quot; : 64.66666666666667 } { &quot;_id&quot; : 2, &quot;variance&quot; : 64.66666666666667 } <\/code><\/pre>\n<p>  <code>$exp<\/code> \u2014 \u0432\u043e\u0437\u0432\u043e\u0434\u0438\u0442 \u0432 \u0441\u0442\u0435\u043f\u0435\u043d\u044c \u042d\u0439\u043b\u0435\u0440\u043e\u0432\u0441\u043a\u043e\u0435 \u0447\u0438\u0441\u043b\u043e. <br \/>  \u0421\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441  <\/p>\n<pre><code class=\"python\">{ exp: &lt;number&gt; } <\/code><\/pre>\n<p>  \u041f\u0440\u0438\u043c\u0435\u0440:  <\/p>\n<pre><code class=\"python\">{ $exp: 0 }\t1 { $exp: 2 }\t7.38905609893065 { $exp: -2 }\t0.1353352832366127 <\/code><\/pre>\n<p>  <code>$trunc<\/code> \u2014 \u0423\u0441\u0435\u043a\u0430\u0435\u0442 \u0447\u0438\u0441\u043b\u043e \u0432 \u0435\u0433\u043e \u0446\u0435\u043b\u043e\u0435. <br \/>  \u0421\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441:  <\/p>\n<pre><code class=\"python\">{ $trunc: &lt;number&gt; } <\/code><\/pre>\n<p>  <\/p>\n<pre><code class=\"python\">{ $trunc: 0 }\t0 { $trunc: 7.80 }\t7 { $trunc: -2.3 }\t-2 <\/code><\/pre>\n<p>  <code>$ceil<\/code> \u2014 \u0412\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u043d\u0430\u0438\u043c\u0435\u043d\u044c\u0448\u0435\u0435 \u0446\u0435\u043b\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435, \u0431\u043e\u043b\u044c\u0448\u0435\u0435 \u0438\u043b\u0438 \u0440\u0430\u0432\u043d\u043e\u0435 \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u043e\u043c\u0443 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0443. <br \/>  \u0421\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441:  <\/p>\n<pre><code class=\"python\">{ $ceil: &lt;number&gt; } <\/code><\/pre>\n<p>  <\/p>\n<pre><code class=\"python\">{ $ceil: 1 }\t         1 { $ceil: 7.80 }\t 8 { $ceil: -2.8 }\t-2 <\/code><\/pre>\n<p>  <code>$floor<\/code> \u2014 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u043d\u0430\u0438\u0431\u043e\u043b\u044c\u0448\u0435\u0435 \u0446\u0435\u043b\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435, \u043c\u0435\u043d\u044c\u0448\u0435\u0435 \u0438\u043b\u0438 \u0440\u0430\u0432\u043d\u043e\u0435 \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u043e\u043c\u0443 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0443. <br \/>  \u0421\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441:  <\/p>\n<pre><code class=\"python\">{ floor: &lt;number&gt; } <\/code><\/pre>\n<p>  \u041f\u0440\u0438\u043c\u0435\u0440\u044b:  <\/p>\n<pre><code class=\"python\">{ $floor: 1 }\t1 { $floor: 7.80 }\t7 { $floor: -2.8 }\t-3 <\/code><\/pre>\n<pre><code class=\"python\">{ _id: 1, value: 9.25 } { _id: 2, value: 8.73 } { _id: 3, value: 4.32 } { _id: 4, value: -5.34 }  db.samples.aggregate([    { $project: { value: 1, floorValue: { $floor: &quot;$value&quot; } } } ])  { &quot;_id&quot; : 1, &quot;value&quot; : 9.25, &quot;floorValue&quot; : 9 } { &quot;_id&quot; : 2, &quot;value&quot; : 8.73, &quot;floorValue&quot; : 8 } { &quot;_id&quot; : 3, &quot;value&quot; : 4.32, &quot;floorValue&quot; : 4 } { &quot;_id&quot; : 4, &quot;value&quot; : -5.34, &quot;floorValue&quot; : -6 } <\/code><\/pre>\n<h4>\u041d\u043e\u0432\u044b\u0435 \u0430\u0433\u0440\u0435\u0433\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0435 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u044b \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u043c\u0430\u0441\u0441\u0438\u0432\u0430\u043c\u0438<\/h4>\n<p>  <code>$slice<\/code> \u2014 \u0412\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u043f\u043e\u0434\u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u043c\u0430\u0441\u0441\u0438\u0432\u0430. <br \/>  \u0421\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441:  <\/p>\n<pre><code class=\"python\">{ $slice: [ &lt;array&gt;, &lt;n&gt; ] } \u0438\u043b\u0438 { $slice: [ &lt;array&gt;, &lt;position&gt;, &lt;n&gt; ] } <\/code><\/pre>\n<p>  { &quot;_id&quot;: 1, \u00abname\u00bb: \u00abdave123\u00bb, favorites: [ \u00abchocolate\u00bb, \u00abcake\u00bb, \u00abbutter\u00bb, \u00abapples\u00bb ] }<br \/>  { &quot;_id&quot;: 2, \u00abname\u00bb: \u00abli\u00bb, favorites: [ \u00abapples\u00bb, \u00abpudding\u00bb, \u00abpie\u00bb ] }<br \/>  { &quot;_id&quot;: 3, \u00abname\u00bb: \u00abahn\u00bb, favorites: [ \u00abpears\u00bb, \u00abpecans\u00bb, \u00abchocolate\u00bb, \u00abcherries\u00bb ] }<br \/>  { &quot;_id&quot;: 4, \u00abname\u00bb: \u00abty\u00bb, favorites: [ \u00abice cream\u00bb ] }<br \/>  \u0412 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435, \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442\u0441\u044f \u043f\u0435\u0440\u0432\u044b\u0435 \u0442\u0440\u0438 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 \u043c\u0430\u0441\u0441\u0438\u0432\u0430 \u0432 <code>favorites<\/code> \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f:  <\/p>\n<pre><code class=\"python\">db.users.aggregate([    { $project: { name: 1, threeFavorites: { $slice: [ &quot;$favorites&quot;, 3 ] } } } ])   { &quot;_id&quot; : 1, &quot;name&quot; : &quot;dave123&quot;, &quot;threeFavorites&quot; : [ &quot;chocolate&quot;, &quot;cake&quot;, &quot;butter&quot; ] } { &quot;_id&quot; : 2, &quot;name&quot; : &quot;li&quot;, &quot;threeFavorites&quot; : [ &quot;apples&quot;, &quot;pudding&quot;, &quot;pie&quot; ] } { &quot;_id&quot; : 3, &quot;name&quot; : &quot;ahn&quot;, &quot;threeFavorites&quot; : [ &quot;pears&quot;, &quot;pecans&quot;, &quot;chocolate&quot; ] } { &quot;_id&quot; : 4, &quot;name&quot; : &quot;ty&quot;, &quot;threeFavorites&quot; : [ &quot;ice cream&quot; ] } <\/code><\/pre>\n<p>  <code>$arrayElemAt<\/code> \u2014 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u043f\u043e \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u043e\u043c\u0443 \u0438\u043d\u0434\u0435\u043a\u0441\u0443 \u0432 \u043c\u0430\u0441\u0441\u0438\u0432\u0435. <br \/>  \u0421\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441:  <\/p>\n<pre><code class=\"python\">{ $arrayElemAt: [ &lt;array&gt;, &lt;idx&gt; ] } <\/code><\/pre>\n<p>  \u041f\u0440\u0438\u043c\u0435\u0440:  <\/p>\n<pre><code class=\"python\">{ $arrayElemAt: [ [ 1, 2, 3 ], 0 ] }\t1 { $arrayElemAt: [ [ 1, 2, 3 ], -2 ] }\t2 { $arrayElemAt: [ [ 1, 2, 3 ], 15 ] } <\/code><\/pre>\n<p>  <code>$concatArrays<\/code> \u2014 \u043a\u043e\u043d\u043a\u0430\u0442\u0435\u043d\u0430\u0446\u0438\u044f \u043c\u0430\u0441\u0441\u0438\u0432\u0430. <br \/>  \u0421\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441:  <\/p>\n<pre><code class=\"python\">{  $concatArrays: [ &lt;array1&gt;, &lt;array2&gt;, ... ] } <\/code><\/pre>\n<p>  \u041f\u0440\u0438\u043c\u0435\u0440:  <\/p>\n<pre><code class=\"python\">{ $concatArrays: [ [ &quot;hello&quot;, &quot; &quot;], [ &quot;world&quot; ] ] }\t[ &quot;hello&quot;, &quot; &quot;, &quot;world&quot; ] { $concatArrays: [ [ &quot;hello&quot;, &quot; &quot;], [ [ &quot;world&quot; ], &quot;again&quot;] ] }\t[ &quot;hello&quot;, &quot; &quot;, [ &quot;world&quot; ], &quot;again&quot; ] <\/code><\/pre>\n<p>  <code>$isArray<\/code> \u2014 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442, \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043b\u0438 \u043e\u043f\u0435\u0440\u0430\u043d\u0434 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043c\u0430\u0441\u0441\u0438\u0432\u043e\u043c. <br \/>  \u0421\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441<br \/>  { $isArray: [  ] }<br \/>  \u0412 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u0435\u0441\u0442\u044c \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u044f <code>warehouses<\/code> \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0449\u0430\u044f \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u044b:  <\/p>\n<pre><code class=\"python\">{ &quot;_id&quot; : 1, instock: [ &quot;chocolate&quot; ], ordered: [ &quot;butter&quot;, &quot;apples&quot; ] } { &quot;_id&quot; : 2, instock: [ &quot;apples&quot;, &quot;pudding&quot;, &quot;pie&quot; ] } { &quot;_id&quot; : 3, instock: [ &quot;pears&quot;, &quot;pecans&quot;], ordered: [ &quot;cherries&quot; ] } { &quot;_id&quot; : 4, instock: [ &quot;ice cream&quot; ], ordered: [ ] } <\/code><\/pre>\n<p>  \u041c\u044b \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c, \u0447\u0442\u043e \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u0438 \u043f\u043e\u043b\u044f <code>instock<\/code>, \u0438 \u043f\u043e\u043b\u044f <code>ordered<\/code>, \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u043c\u0430\u0441\u0441\u0438\u0432\u0430\u043c\u0438, \u0438 \u0442\u043e\u0433\u0434\u0430 \u043a\u043e\u043d\u043a\u0430\u0442\u0435\u043d\u0438\u0440\u0443\u0435\u043c \u0438\u0445, \u0438\u043d\u0430\u0447\u0435 \u0432\u044b\u0432\u043e\u0434\u0438\u043c \u043d\u0430\u0434\u043f\u0438\u0441\u044c, \u0447\u0442\u043e \u044d\u0442\u043e \u043d\u0435 \u0442\u0430\u043a:<\/p>\n<pre><code class=\"python\">db.warehouses.aggregate([    { $project:       { items:           { $cond:             {               if: { $and: [ { $isArray: &quot;$instock&quot; }, { $isArray: &quot;$ordered&quot; } ] },               then: { $concatArrays: [ &quot;$instock&quot;, &quot;$ordered&quot; ] },               else: &quot;One or more fields is not an array.&quot;             }           }       }    } ])   { &quot;_id&quot; : 1, &quot;items&quot; : [ &quot;chocolate&quot;, &quot;butter&quot;, &quot;apples&quot; ] } { &quot;_id&quot; : 2, &quot;items&quot; : &quot;One or more fields is not an array.&quot; } { &quot;_id&quot; : 3, &quot;items&quot; : [ &quot;pears&quot;, &quot;pecans&quot;, &quot;cherries&quot; ] } { &quot;_id&quot; : 4, &quot;items&quot; : [ &quot;ice cream&quot; ] }  <\/code><\/pre>\n<p>  <code>$filter<\/code> \u2014 \u0432\u044b\u0431\u0438\u0440\u0430\u0435\u0442 \u043f\u043e\u0434\u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u043c\u0430\u0441\u0441\u0438\u0432\u0430 \u043f\u043e \u0443\u0441\u043b\u043e\u0432\u0438\u044e. <br \/>  \u0421\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441<br \/>  {<br \/>   $filter:<br \/>   {<br \/>   input: ,<br \/>   as: ,<br \/>   cond:  }<br \/>  }<br \/>  \u041f\u0440\u0438\u043c\u0435\u0440:  <\/p>\n<pre><code class=\"python\">{   $filter: {      input: [ 1, &quot;a&quot;, 2, null, 3.1, NumberLong(4), &quot;5&quot; ],      as: &quot;num&quot;,      cond: { $and: [         { $gte: [ &quot;$$num&quot;, NumberLong(&quot;-9223372036854775807&quot;) ] },         { $lte: [ &quot;$$num&quot;, NumberLong(&quot;9223372036854775807&quot;) ] }       ] }   } }   [ 1, 2, 3.1, NumberLong(4) ] <\/code><\/pre>\n<h4>\u041d\u043e\u0432\u043e\u0435 \u0434\u043b\u044f \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u0430 $project<\/h4>\n<p>  \u0412 <code>mongodb 3.2<\/code>, \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440 <code>$project<\/code>, \u0441\u0442\u0430\u043b \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0442\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u043a\u0432\u0430\u0434\u0440\u0430\u0442\u043d\u044b\u0445 \u0441\u043a\u043e\u0431\u043e\u043a <code>[]<\/code>, \u0447\u0442\u043e\u0431\u044b \u043d\u0435\u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u043d\u043e\u0432\u044b\u0439 \u043c\u0430\u0441\u0441\u0438\u0432 \u0438\u0437 \u043f\u043e\u043b\u0435\u0439. <br \/>  \u0412 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u0435\u0441\u0442\u044c \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442:  <\/p>\n<pre><code class=\"python\">{ &quot;_id&quot; : ObjectId(&quot;55ad167f320c6be244eb3b95&quot;), &quot;x&quot; : 1, &quot;y&quot; : 1 } <\/code><\/pre>\n<p>  \u041e\u043f\u0435\u0440\u0430\u0442\u043e\u0440 <code>$project<\/code> \u0438\u0437 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 <code>x<\/code> \u0438 <code>y<\/code> \u0441\u043e\u0437\u0434\u0430\u0435\u0442 \u043d\u043e\u0432\u043e\u0435 \u043f\u043e\u043b\u0435 <code>myArray<\/code>:  <\/p>\n<pre><code class=\"python\">db.collection.aggregate( [ { $project: { myArray: [ &quot;$x&quot;, &quot;$y&quot; ] } } ] ) <\/code><\/pre>\n<p>  \u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442:  <\/p>\n<pre><code class=\"python\">{ &quot;_id&quot; : ObjectId(&quot;55ad167f320c6be244eb3b95&quot;), &quot;myArray&quot; : [ 1, 1 ] } <\/code><\/pre>\n<p>  <\/p>\n<h3><a name=\"3\"><\/a><font color=\"orange\"> \u041d\u043e\u0432\u044b\u0435 \u043e\u043f\u0446\u0438\u0438 \u0432 \u0443\u0442\u0438\u043b\u0438\u0442\u0430\u0445 \u0438\u043c\u043f\u043e\u0440\u0442\u0430, \u044d\u043a\u0441\u043f\u043e\u0440\u0442\u0430<\/font><\/h3>\n<p>  mongorestore \u0438 mongodump \u0442\u0435\u043f\u0435\u0440\u044c \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u044e\u0442 \u0440\u0430\u0431\u043e\u0442\u0443 \u0441 \u0430\u0440\u0445\u0438\u0432\u0430\u043c\u0438, \u0438 \u043d\u0435 \u043d\u0430\u0434\u043e, \u0435\u0441\u043b\u0438 \u0432 \u0431\u0430\u0437\u0435 \u043c\u043d\u043e\u0433\u043e \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u0439, \u043a\u0430\u0436\u0434\u044b\u0439 \u0440\u0430\u0437 \u0434\u043b\u044f \u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0443\u043f\u0430\u043a\u043e\u0432\u044b\u0432\u0430\u0442\u044c.<\/p>\n<p>  \u0421\u043b\u0435\u0434\u0443\u044e\u0449\u0430\u044f \u043a\u043e\u043c\u0430\u043d\u0434\u0430 \u0440\u0430\u0441\u043f\u0430\u043a\u0443\u0435\u0442 \u0438\u0437 \u0430\u0440\u0445\u0438\u0432\u0430 <code>test.20150715.archive<\/code> \u0431\u0430\u0437\u0443 \u0434\u0430\u043d\u043d\u044b\u0445 <code>test<\/code>. \u0418 \u0438\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u0443\u0435\u0442 \u0435\u0451.  <\/p>\n<pre><code class=\"bash\">mongorestore --archive=test.20150715.archive --db test <\/code><\/pre>\n<p>  \u0427\u0442\u043e\u0431\u044b \u044d\u043a\u0441\u043f\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u0438\u0437 \u0432\u0432\u043e\u0434\u0430, \u043d\u0443\u0436\u043d\u043e \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c <code>mongorestore<\/code> \u0441 \u043e\u043f\u0446\u0438\u0435\u0439 <code>archive<\/code> \u043d\u0435 \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u044f \u0438\u043c\u044f \u0444\u0430\u0439\u043b\u0430. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440:  <\/p>\n<pre><code class=\"python\">mongodump --archive --db test --port 27017 | mongorestore --archive --port 27018 <\/code><\/pre>\n<h3><a name=\"5\"><\/a><font color=\"orange\"> \u041d\u043e\u0432\u043e\u0432\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u0432 CRUD<\/font><\/h3>\n<p>  \u0414\u043b\u044f \u0441\u043e\u0433\u043b\u0430\u0441\u043e\u0432\u0430\u043d\u0438\u044f \u0441 <code>CRUD (Create\/Read\/Update\/Delete) API<\/code> \u0434\u0440\u0430\u0439\u0432\u0435\u0440\u043e\u0432, \u0434\u043b\u044f <code>mongo shell<\/code> \u0431\u044b\u043b\u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u044b \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u043c\u0435\u0442\u043e\u0434\u044b.<\/p>\n<p>  <code>db.collection.bulkWrite()<\/code> \u2014 \u0412\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439 \u0437\u0430\u043f\u0438\u0441\u0438, \u0441 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430\u043c\u0438 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0434\u043b\u044f \u043f\u043e\u0440\u044f\u0434\u043a\u0430 \u0438\u0441\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f.<br \/>  \u0421\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u043a\u043e\u0434, \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0441\u043e\u0431\u043e\u0439 \u043d\u0435\u0443\u043f\u043e\u0440\u044f\u0434\u043e\u0447\u0435\u043d\u043d\u044b\u0439 <code>bulkWrite()<\/code>, \u0438\u0437 \u0448\u0435\u0441\u0442\u0438 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439:  <\/p>\n<pre><code class=\"python\">db.collection.bulkWrite(    [       { insertOne : &lt;document&gt; },       { updateOne : &lt;document&gt; },       { updateMany : &lt;document&gt; },       { replaceOne : &lt;document&gt; },       { deleteOne : &lt;document&gt; },       { deleteMany : &lt;document&gt; }    ],    { ordered : false } ) <\/code><\/pre>\n<p>  \u0421 <code>ordered : false<\/code>, \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u0440\u0430\u0431\u043e\u0442\u044b \u043c\u043e\u0433\u0443\u0442 \u043e\u0442\u043b\u0438\u0447\u0430\u0442\u044c\u0441\u044f. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, <code>deleteOne<\/code> \u0438\u043b\u0438 <code>deleteMany<\/code> \u043c\u043e\u0436\u0435\u0442 \u0443\u0434\u0430\u043b\u0438\u0442\u044c \u0431\u043e\u043b\u044c\u0448\u0435 \u0438\u043b\u0438 \u043c\u0435\u043d\u044c\u0448\u0435 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u043e\u0432 \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u043f\u043e\u0440\u044f\u0434\u043a\u0430 \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439 <code>insertOne<\/code>, <code>updateOne<\/code>, <code>updateMany<\/code> \u0438\u043b\u0438 <code>replaceOne<\/code>.<\/p>\n<p>  <code>db.collection.deleteMany()<\/code> \u2014 \u044d\u043a\u0432\u0438\u0432\u0430\u043b\u0435\u043d\u0442 <code>db.collection.remove()<\/code>.<br \/>  <code>db.collection.deleteOne()<\/code> \u2014 \u044d\u043a\u0432\u0438\u0432\u0430\u043b\u0435\u043d\u0442 <code>db.collection.remove()<\/code> \u043d\u043e \u0441 <code>justOne<\/code> \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u044b\u043c \u043a\u0430\u043a <code>true<\/code><br \/>  \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u2014 <code>db.collection.remove( &lt;query&gt;, true )<\/code> \u0438\u043b\u0438 <code>db.collection.remove( &lt;query&gt;, { justOne: true } )<\/code>.<br \/>  <code>db.collection.findOneAndDelete()<\/code> \u2014 \u044d\u043a\u0432\u0438\u0432\u0430\u043b\u0435\u043d\u0442 <code>db.collection.findAndModify()<\/code> \u043d\u043e \u0441 remove \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u044b\u043c \u043a\u0430\u043a true.<br \/>  <code>db.collection.findOneAndReplace()<\/code> \u2014 \u044d\u043a\u0432\u0438\u0432\u0430\u043b\u0435\u043d\u0442 <code>db.collection.findAndModify()<\/code>.<br \/>  <code>db.collection.findOneAndUpdate()<\/code> \u2014 \u044d\u043a\u0432\u0438\u0432\u0430\u043b\u0435\u043d\u0442 <code>db.collection.findAndModify()<\/code> \u043d\u043e \u0441 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u044b\u043c\u0438 \u0434\u043b\u044f update \u0430\u0442\u043e\u043c\u0430\u0440\u043d\u044b\u043c\u0438 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u0430\u043c\u0438.<br \/>  <code>db.collection.insertMany()<\/code> \u2014 \u044d\u043a\u0432\u0438\u0432\u0430\u043b\u0435\u043d\u0442 <code>db.collection.insert()<\/code> \u0441 \u043c\u0430\u0441\u0441\u0438\u0432\u043e\u043c \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u043e\u0432 \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430.<br \/>  <code>db.collection.insertOne()<\/code> \u2014 \u044d\u043a\u0432\u0438\u0432\u0430\u043b\u0435\u043d\u0442 <code>db.collection.insert()<\/code> \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430 \u043e\u0434\u0438\u043d \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442.<br \/>  <code>db.collection.replaceOne()<\/code> \u2014 \u044d\u043a\u0432\u0438\u0432\u0430\u043b\u0435\u043d\u0442 \u043c\u0435\u0442\u043e\u0434\u0430 <code>db.collection.update( &lt;query&gt;, &lt;update&gt; )<\/code> \u0434\u043b\u044f \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430 \u043a\u0430\u043a \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430 \u0434\u043b\u044f <code>&lt;update&gt;<\/code>.<br \/>  <code>db.collection.updateMany()<\/code> \u2014 \u044d\u043a\u0432\u0438\u0432\u0430\u043b\u0435\u043d\u0442 <code>db.collection.update( &lt;query&gt;, &lt;update&gt;, { multi: true, ... })<\/code> \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u043e\u043f\u0446\u0438\u0438 <code>multi<\/code> \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u043e\u0439 \u043a\u0430\u043a <code>true<\/code>.<br \/>  <code>db.collection.updateOne()<\/code> \u2014 \u044d\u043a\u0432\u0438\u0432\u0430\u043b\u0435\u043d\u0442 <code>db.collection.update( &lt;query&gt;, &lt;update&gt; )<\/code> <\/p>\n<h3><a name=\"6\"><\/a><font color=\"orange\"> WiredTiger \u0438 fsyncLock<\/font><\/h3>\n<p>  \u041d\u0430\u0447\u0438\u043d\u0430\u044f \u0441 <code>MongoDB 3.2<\/code>, \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0435 <code>WiredTiger<\/code> \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u043a\u043e\u043c\u0430\u043d\u0434\u0443 <a href=\"https:\/\/docs.mongodb.org\/manual\/reference\/command\/fsync\/#dbcmd.fsync\">fsync<\/a> \u0441 \u043e\u043f\u0446\u0438\u0435\u0439 <code>lock<\/code> \u0438\u043b\u0438 \u043c\u0435\u0442\u043e\u0434\u0430 <code>mongo shell db.fsyncLock()&lt;code&gt;. \u0422\u043e \u0435\u0441\u0442\u044c, \u0434\u043b\u044f \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0430 &lt;code&gt;WiredTiger<\/code>, \u044d\u0442\u0438 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u043c\u043e\u0433\u0443\u0442 \u0433\u0430\u0440\u0430\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c, \u0447\u0442\u043e \u0444\u0430\u0439\u043b\u044b \u0434\u0430\u043d\u043d\u044b\u0445 \u043d\u0435 \u0438\u0437\u043c\u0435\u043d\u044f\u0442\u0441\u044f, \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0432\u0430\u044f \u0441\u043e\u0433\u043b\u0430\u0441\u043e\u0432\u0430\u043d\u043d\u043e\u0441\u0442\u044c \u0432 \u043f\u0440\u0438 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0438 \u0440\u0435\u0437\u0435\u0440\u0432\u043d\u044b\u0445 \u043a\u043e\u043f\u0438\u0439.<br \/>  \u0422\u0430\u043a\u0436\u0435 \u0432 \u044d\u0442\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0438 <code>WiredTiger<\/code> \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0435\u043c \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e.<\/p>\n<h3><a name=\"7\"><\/a><font color=\"orange\"> \u041d\u043e\u0432\u043e\u0435 GUI compass <\/font><\/h3>\n<p>  \u0412 \u043d\u043e\u0432\u043e\u043c <code>Mongodb<\/code>, \u0432\u043f\u0435\u0440\u0432\u044b\u0435, \u043e\u0442 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u0432 \u043f\u043e\u044f\u0432\u0438\u043b\u043e\u0441\u044c GUI \u043f\u0440\u0438\u0447\u0435\u043c \u043d\u0435 \u043d\u0435 \u043e\u0434\u043d\u043e. \u041d\u0430\u0447\u043d\u0435\u043c \u0441 <code>MongoDB Compass<\/code>. \u041f\u043e\u0441\u043b\u0435 \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u0430\u043d\u043e\u043d\u0441\u0430 \u043a\u043e\u0433\u0434\u0430 \u043a\u0440\u043e\u043c\u0435 \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0438 \u0435\u0449\u0435 \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0435 \u0431\u044b\u043b\u043e \u044f \u043f\u043e\u0434\u0443\u043c\u0430\u043b \u0447\u0442\u043e compass \u0441\u043a\u043e\u0440\u0435\u0435 \u0432\u0441\u0435\u0433\u043e \u0431\u0443\u0434\u0435\u0442 c web \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u043e\u043c. \u041c\u043e\u0435\u0439 \u043f\u0435\u0440\u0432\u043e\u0439 nosql \u0431\u0430\u0437\u043e\u0439 \u0431\u044b\u043b <code>couchdb<\/code> \u0438 \u0442\u043e\u0433\u0434\u0430 \u043c\u043d\u0435 \u043e\u0447\u0435\u043d\u044c \u043d\u0440\u0430\u0432\u0438\u043b\u0441\u044f <code>futon<\/code>. <\/p>\n<p>  \u041d\u043e \u043e\u043a\u0430\u0437\u0430\u043b\u043e\u0441\u044c \u0447\u0442\u043e compass, \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043e\u0431\u044b\u0447\u043d\u043e\u0439 \u0434\u0435\u0441\u043a\u0442\u043e\u043f\u043d\u043e\u0439 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043e\u0439, \u0438 \u043a \u0441\u043e\u0436\u0430\u043b\u0435\u043d\u0438\u044e \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u0434 Mac OS \u0438 Windows. \u0418 \u043d\u0430\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u044f \u043f\u043e\u043d\u044f\u043b \u0431\u0435\u0437 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f, \u0430 \u0442\u043e\u043b\u044c\u043a\u043e \u0441 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c\u044e \u043f\u0440\u043e\u0441\u043c\u043e\u0442\u0440\u0430 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u043e\u0432, \u0438 \u0441 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c\u044e \u0434\u0435\u043b\u0430\u0442\u044c \u0437\u0430\u043f\u0440\u043e\u0441\u044b.<\/p>\n<p>  \u0418\u0442\u0430\u043a, \u0447\u0442\u043e\u0431 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u043f\u043e\u0438\u0433\u0440\u0430\u0442\u044c\u0441\u044f \u0441 \u044d\u0442\u0438\u043c GUI \u043f\u043e\u0441\u0442\u0430\u0432\u0438\u043c \u043f\u043e\u0434 Windows mongoDB \u0438 \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u043c, \u0447\u0442\u043e\u0431\u044b \u0432\u0441\u0435 \u0437\u0430\u0440\u0430\u0431\u043e\u0442\u0430\u043b\u043e:<br \/>  \u0421\u043a\u0430\u0447\u0438\u0432\u0430\u0435\u043c, \u043f\u0440\u0438 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0435 \u043b\u0443\u0447\u0448\u0435 \u0432\u044b\u0431\u0438\u0440\u0430\u0442\u044c \u201c\u0432\u0440\u0443\u0447\u043d\u0443\u044e\u201d \u0438 \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u043c\u0435\u0441\u0442\u043e \u0434\u043b\u044f \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 <code>C:\\mongodb<\/code>.<br \/>  \u041f\u043e\u0441\u043b\u0435 \u044d\u0442\u043e\u0433\u043e \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u043c \u043e\u0442 \u0438\u043c\u0435\u043d\u0438 \u0430\u0434\u043c\u0438\u043d\u0438\u0441\u0442\u0440\u0430\u0442\u043e\u0440\u0430 \u043a\u043e\u043d\u0441\u043e\u043b\u044c \u0438 \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043f\u0430\u043f\u043e\u043a:  <\/p>\n<pre><code class=\"bash\">mkdir c:\\data\\db mkdir c:\\data\\log <\/code><\/pre>\n<p>  \u0410 \u043f\u043e\u0442\u043e\u043c \u0441\u043e\u0437\u0434\u0430\u0432 \u0432 \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0435 \u0441 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u043e\u0439 <code>C:\\mongodb\\mongod.cfg<\/code> \u0444\u0430\u0439\u043b\u0438\u043a \u0432\u043f\u0438\u0448\u0435\u043c \u0442\u0430\u043c \u043f\u0430\u0440\u0443 \u0441\u0442\u0440\u043e\u0447\u0435\u043a:  <\/p>\n<pre><code class=\"bash\">systemLog:     destination: file     path: c:\\data\\log\\mongod.log storage:     dbPath: c:\\data\\db <\/code><\/pre>\n<p>  \u0414\u0430\u043b\u044c\u0448\u0435 \u0441\u0434\u0435\u043b\u0430\u0435\u043c mongodb \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u043c:  <\/p>\n<pre><code class=\"bash\">&quot;C:\\mongodb\\bin\\mongod.exe&quot; --config &quot;C:\\mongodb\\mongod.cfg&quot; --install <\/code><\/pre>\n<p>  \u0418 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u043c \u044d\u0442\u043e\u0442 \u0441\u0435\u0440\u0432\u0438\u0441:  <\/p>\n<pre><code class=\"bash\">net start MongoDB <\/code><\/pre>\n<p>  \u0412 \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u0435, \u0432\u0441\u0451. \u041d\u043e \u0443 \u043c\u0435\u043d\u044f \u043d\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c \u043f\u0440\u0438\u043a\u043e\u043d\u043d\u0435\u043a\u0442\u0438\u0442\u044c\u0441\u044f \u043a \u0431\u0430\u0437\u0435 \u043f\u043e\u043a\u0430 \u044f \u043d\u0435 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u043b \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u0438 \u043a\u043b\u0438\u0435\u043d\u0442 \u043a \u043c\u043e\u043d\u0433\u043e, <code>c:\\mongodb\\mongo.exe<\/code><\/p>\n<p>  \u041f\u043e\u0441\u043b\u0435 \u044d\u0442\u043e\u0433\u043e \u0441\u043a\u0430\u0447\u0438\u0432\u0430\u0435\u043c \u043f\u043e <a href=\"http:\/\/www.mongodb.com\/download-center#compass\">\u0441\u0441\u044b\u043b\u043a\u0435<\/a> \u0441\u0430\u043c compass, \u0442\u0430\u043c \u043d\u0430\u0434\u043e \u0441\u0438\u043c\u0432\u043e\u043b\u0438\u0447\u0435\u0441\u043a\u0438 \u0437\u0430\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u043f\u0430\u0440\u0443 \u043f\u043e\u043b\u0435\u0439 \u0438 \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c. \u041f\u043e\u0441\u043b\u0435 \u044d\u0442\u043e\u0433\u043e \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u0438 \u0432\u0438\u0434\u0438\u043c \u043e\u043a\u043e\u0448\u043a\u043e \u043f\u0440\u0438\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u044f:<br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/d07\/04d\/ab2\/d0704dab22b12771949ff76e4ee1a214.png\"\/><br \/>  \u0415\u0441\u043b\u0438 \u0432\u0441\u0435 \u0443\u0434\u0430\u0447\u043d\u043e \u0442\u043e \u043a\u043e\u043d\u043d\u0435\u043a\u0442\u0438\u043c\u0441\u044f \u0438 \u0432 \u043e\u0442\u043a\u0440\u044b\u0432\u0448\u0435\u043c\u0441\u044f \u043e\u043a\u043d\u0435, \u0432\u0438\u0434\u0438\u043c \u0441\u043b\u0435\u0432\u0430 \u0441\u043f\u0438\u0441\u043e\u043a \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u0439 \u0438 \u0431\u0430\u0437, \u043f\u043e \u0446\u0435\u043d\u0442\u0440\u0443 \u0432\u0438\u0437\u0443\u0430\u043b\u044c\u043d\u043e\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u043e\u0432 \u043d\u0430\u0445\u043e\u0434\u044f\u0449\u0438\u0445\u0441\u044f \u0432 \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u0439 \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u0438. \u041f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043f\u0440\u0435\u0434\u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u043e \u0438\u0441\u043a\u043b\u044e\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0434\u043b\u044f \u0441\u043e\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432, \u043a\u043e\u0438 \u0441\u0432\u0435\u0440\u0445\u0443 \u0432 \u0441\u0442\u0440\u043e\u043a\u0435 \u0432\u0438\u0434\u043d\u044b. <\/p>\n<p>  \u041d\u0443 \u0430 \u0441\u043f\u0440\u0430\u0432\u0430, \u0432 \u043a\u043e\u043b\u043e\u043d\u043a\u0435, \u0435\u0441\u043b\u0438 \u0435\u0451 \u043e\u0442\u043a\u0440\u044b\u0442\u044c \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0439 \u0441\u0442\u0440\u0435\u043b\u043e\u0447\u043a\u0438 (\u043d\u0430\u0432\u0435\u0440\u043d\u043e\u0435, \u0435\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u0430\u044f \u043f\u043e\u043b\u0435\u0437\u043d\u0430\u044f \u0448\u0442\u0443\u043a\u0430) \u044d\u0442\u0438 \u0441\u0430\u043c\u044b\u0435 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u044b \u0432 \u0432\u0438\u0434\u0435 json. <br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/826\/906\/b65\/826906b656d6679961c8fd643dd02890.gif\" width=\"100%\"\/><\/p>\n<p>  \u0412 \u0446\u0435\u043b\u043e\u043c, \u043e\u0431\u0449\u0438\u0435 \u0432\u043f\u0435\u0447\u0430\u0442\u043b\u0435\u043d\u0438\u044f \u0442\u0430\u043a\u0438\u0435, \u0447\u0442\u043e GUI \u044d\u0442\u043e \u0441\u043a\u043e\u0440\u0435\u0435 \u0438\u043c\u0438\u0434\u0436\u0435\u0432\u044b\u0439 \u0445\u043e\u0434, \u0447\u0435\u043c \u043d\u0435\u0441\u0443\u0449\u0438\u0439 \u043a\u0430\u043a\u0443\u044e-\u0442\u043e \u0440\u0435\u0430\u043b\u044c\u043d\u0443\u044e \u043f\u043e\u043b\u044c\u0437\u0443 \u0441\u043e\u043e\u0431\u0449\u0435\u0441\u0442\u0432\u0443.<\/p>\n<p>  <i>P.S. \u041f\u0440\u043e\u0441\u044c\u0431\u0430 \u043e \u0433\u0440\u0430\u043c\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u043e\u0448\u0438\u0431\u043a\u0430\u0445 \u0438 \u043e\u0448\u0438\u0431\u043a\u0430\u0445 \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u0430 \u043f\u0438\u0441\u0430\u0442\u044c \u0432 \u043b\u0438\u0447\u043a\u0443.<\/i><\/p>\n<p>  <a href=\"https:\/\/docs.mongodb.org\/v3.0\/tutorial\/install-mongodb-on-windows\/\">\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 mongodb \u043f\u043e\u0434 windows<\/a><br \/>  <a href=\"https:\/\/docs.mongodb.org\/manual\/products\/compass\/\">\u0421\u043f\u0440\u0430\u0432\u043a\u0430 \u043f\u043e compass<\/a><br \/>  <a href=\"http:\/\/www.mongodb.com\/download-center#compass\">\u0421\u043a\u0430\u0447\u0430\u0442\u044c mongodb compass<\/a><\/p>\n<p>  <a href=\"https:\/\/docs.mongodb.org\/manual\/release-notes\/3.2\/\">\u0414\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044f \u043f\u043e \u043d\u043e\u0432\u044b\u043c \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430\u043c<\/a><br \/>  <a href=\"https:\/\/docs.mongodb.org\/manual\/core\/index-partial\/\">\u0427\u0430\u0441\u0442\u0438\u0447\u043d\u044b\u0439 \u0438\u043d\u0434\u0435\u043a\u0441<\/a><br \/>  <a href=\"https:\/\/docs.mongodb.org\/manual\/core\/document-validation\/\">\u0412\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u044f \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u043e\u0432<\/a><\/h4>\n<div class=\"clear\"><\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"http:\/\/habrahabr.ru\/post\/192870\/\"> http:\/\/habrahabr.ru\/post\/192870\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>       <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/e36\/58a\/ca6\/e3658aca69ab496895f5bc53c7357632.jpeg\"\/><br \/>  \u041d\u0430 \u0434\u043d\u044f\u0445 \u0432\u044b\u0448\u0435\u043b \u043d\u043e\u0432\u044b\u0439 \u0441\u0442\u0430\u0431\u0438\u043b\u044c\u043d\u044b\u0439 \u0440\u0435\u043b\u0438\u0437 <code>mongodb<\/code>. \u0412 \u044d\u0442\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0438 \u0431\u044b\u043b \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d \u0440\u044f\u0434 \u043d\u043e\u0432\u043e\u0432\u0432\u0435\u0434\u0435\u043d\u0438\u0439 \u0442\u0430\u043a\u0438\u0445 \u043a\u0430\u043a \u043d\u043e\u0432\u044b\u0439 <code>GUI<\/code> \u0434\u043b\u044f \u0432\u0438\u0437\u0443\u0430\u043b\u044c\u043d\u043e\u0439 \u0440\u0430\u0431\u043e\u0442\u044b \u0441 <code>mongodb<\/code>, <code>INNER JOIN<\/code>, \u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u044f \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430 \u0438 \u0442.\u0434. \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0438\u0437 \u044d\u0442\u0438\u0445 \u0441\u0432\u043e\u0439\u0441\u0442\u0432 \u043c\u044b \u0438 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043d\u0430 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0438\u0445 \u043f\u0440\u0438\u043c\u0435\u0440\u0430\u0445 \u043d\u0438\u0436\u0435.   <\/p>\n<ul>\n<li><a href=\"#0\"> \u0427\u0430\u0441\u0442\u0438\u0447\u043d\u044b\u0439 ( partial ) \u0438\u043d\u0434\u0435\u043a\u0441 <\/a><\/li>\n<li><a href=\"#1\"> \u0412\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u044f <\/a><\/li>\n<li><a href=\"#2\"> \u041d\u043e\u0432\u043e\u0432\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u0430\u0433\u0440\u0435\u0433\u0430\u0446\u0438\u043e\u043d\u043d\u043e\u0433\u043e \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0430 <\/a><\/li>\n<li><a href=\"#3\"> \u041d\u043e\u0432\u044b\u0435 \u043e\u043f\u0446\u0438\u0438 \u0432 \u0443\u0442\u0438\u043b\u0438\u0442\u0430\u0445 \u0438\u043c\u043f\u043e\u0440\u0442\u0430 \u044d\u043a\u0441\u043f\u043e\u0440\u0442\u0430<\/a><\/li>\n<li><a href=\"#5\"> \u041d\u043e\u0432\u043e\u0432\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u0432 CRUD<\/a><\/li>\n<li><a href=\"#6\"> WiredTiger \u0438 fsyncLock<\/a><\/li>\n<li><a href=\"#7\"> \u041d\u043e\u0432\u043e\u0435 GUI compass<\/a><\/li>\n<\/ul>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-270389","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/270389","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=270389"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/270389\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=270389"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=270389"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=270389"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}