{"id":120742,"date":"2026-11-01T07:40:36","date_gmt":"2026-10-31T23:40:36","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/120742.html"},"modified":"2026-11-01T07:40:36","modified_gmt":"2026-10-31T23:40:36","slug":"mongodb-%e9%9b%86%e5%90%88%e6%a0%a1%e9%aa%8c%e5%99%a8%e4%b8%ad-now-%e4%b8%8d%e5%8a%a8%e6%80%81%e6%b1%82%e5%80%bc%e7%9a%84%e5%8e%9f%e5%9b%a0%e4%b8%8e%e6%9b%bf%e4%bb%a3%e6%96%b9%e6%a1%88","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/120742.html","title":{"rendered":"MongoDB \u96c6\u5408\u6821\u9a8c\u5668\u4e2d $$NOW \u4e0d\u52a8\u6001\u6c42\u503c\u7684\u539f\u56e0\u4e0e\u66ff\u4ee3\u65b9\u6848"},"content":{"rendered":"<p>\u7ed9\u96c6\u5408\u52a0\u6821\u9a8c\u89c4\u5219\uff0c\u9650\u5236 joiningDate \u4e0d\u5f97\u665a\u4e8e\\&#8221;\u5f53\u524d\u65f6\u95f4\\&#8221;\uff0c\u5199\u51fa\u6765\u5f88\u81ea\u7136\uff1a$jsonSchema \u7ba1\u7c7b\u578b\uff0c$expr \u914d\u5408 $$NOW \u7ba1\u65f6\u5e8f\u3002\u5b9e\u9645\u8fd0\u884c\u5374\u53d1\u73b0\u6821\u9a8c\u50cf\u662f\u88ab\u51bb\u7ed3\u5728\u4e86\u521b\u5efa\u96c6\u5408\u7684\u90a3\u4e00\u523b\u2014\u2014\u6bd4\u521b\u5efa\u65f6\u523b\u65e9\u7684\u65e5\u671f\u80fd\u901a\u8fc7\uff0c\u6bd4\u521b\u5efa\u65f6\u523b\u665a\u7684\u65e5\u671f\u53cd\u800c\u88ab\u62d2\u7edd\u3002<\/p>\n<h3>\u95ee\u9898\u73b0\u8c61<\/h3>\n<p>\u521b\u5efa\u96c6\u5408\u65f6\u7684\u6821\u9a8c\u5668\uff1a<\/p>\n<p>db<span class=\"token punctuation\">.<\/span><span class=\"token function\">createCollection<\/span><span class=\"token punctuation\">(<\/span><span class=\"token string\">\\&#8221;employees\\&#8221;<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token punctuation\">{<\/p>\n<p>   <\/span><br \/>\n  <span class=\"token literal-property property\">validator<\/span><span class=\"token operator\">:<\/span> <span class=\"token punctuation\">{<\/p>\n<p>   <\/span><br \/>\n    <span class=\"token literal-property property\">$and<\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u7ed9\u96c6\u5408\u52a0\u6821\u9a8c\u89c4\u5219\uff0c\u9650\u5236 joiningDate \u4e0d\u5f97\u665a\u4e8e\\&#8221;\u5f53\u524d\u65f6\u95f4\\&#8221;\uff0c\u5199\u51fa\u6765\u5f88\u81ea\u7136\uff1a$jsonSchema \u7ba1\u7c7b\u578b\uff0c$expr \u914d\u5408 $$NOW \u7ba1\u65f6\u5e8f\u3002\u5b9e\u9645\u8fd0\u884c\u5374\u53d1\u73b0\u6821\u9a8c\u50cf\u662f\u88ab\u51bb\u7ed3\u5728\u4e86\u521b\u5efa\u96c6\u5408\u7684\u90a3\u4e00\u523b\u2014\u2014\u6bd4\u521b\u5efa\u65f6\u523b\u65e9\u7684\u65e5\u671f\u80fd\u901a\u8fc7\uff0c\u6bd4\u521b\u5efa\u65f6\u523b\u665a\u7684\u65e5\u671f\u53cd\u800c\u88ab\u62d2\u7edd\u3002<br \/>\n\u95ee\u9898\u73b0\u8c61<br \/>\n\u521b\u5efa\u96c6\u5408\u65f6\u7684\u6821\u9a8c\u5668\uff1a<br \/>\ndb.createCollection(\\&#8221;employees\\&#8221;, {validator: {$and<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[1818,81,801,1578,1649],"topic":[],"class_list":["post-120742","post","type-post","status-publish","format-standard","hentry","category-server","tag-numpy","tag-python","tag-801","tag-1578","tag-1649"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>MongoDB \u96c6\u5408\u6821\u9a8c\u5668\u4e2d $$NOW \u4e0d\u52a8\u6001\u6c42\u503c\u7684\u539f\u56e0\u4e0e\u66ff\u4ee3\u65b9\u6848 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.wsisp.com\/helps\/120742.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"MongoDB \u96c6\u5408\u6821\u9a8c\u5668\u4e2d $$NOW \u4e0d\u52a8\u6001\u6c42\u503c\u7684\u539f\u56e0\u4e0e\u66ff\u4ee3\u65b9\u6848 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u7ed9\u96c6\u5408\u52a0\u6821\u9a8c\u89c4\u5219\uff0c\u9650\u5236 joiningDate \u4e0d\u5f97\u665a\u4e8e&quot;\u5f53\u524d\u65f6\u95f4&quot;\uff0c\u5199\u51fa\u6765\u5f88\u81ea\u7136\uff1a$jsonSchema \u7ba1\u7c7b\u578b\uff0c$expr \u914d\u5408 $$NOW \u7ba1\u65f6\u5e8f\u3002\u5b9e\u9645\u8fd0\u884c\u5374\u53d1\u73b0\u6821\u9a8c\u50cf\u662f\u88ab\u51bb\u7ed3\u5728\u4e86\u521b\u5efa\u96c6\u5408\u7684\u90a3\u4e00\u523b\u2014\u2014\u6bd4\u521b\u5efa\u65f6\u523b\u65e9\u7684\u65e5\u671f\u80fd\u901a\u8fc7\uff0c\u6bd4\u521b\u5efa\u65f6\u523b\u665a\u7684\u65e5\u671f\u53cd\u800c\u88ab\u62d2\u7edd\u3002 \u95ee\u9898\u73b0\u8c61 \u521b\u5efa\u96c6\u5408\u65f6\u7684\u6821\u9a8c\u5668\uff1a db.createCollection(&quot;employees&quot;, {validator: {$and\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/120742.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2026-10-31T23:40:36+00:00\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/120742.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/120742.html\",\"name\":\"MongoDB \u96c6\u5408\u6821\u9a8c\u5668\u4e2d $$NOW \u4e0d\u52a8\u6001\u6c42\u503c\u7684\u539f\u56e0\u4e0e\u66ff\u4ee3\u65b9\u6848 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2026-10-31T23:40:36+00:00\",\"dateModified\":\"2026-10-31T23:40:36+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/120742.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/120742.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/120742.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"MongoDB \u96c6\u5408\u6821\u9a8c\u5668\u4e2d $$NOW \u4e0d\u52a8\u6001\u6c42\u503c\u7684\u539f\u56e0\u4e0e\u66ff\u4ee3\u65b9\u6848\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\",\"url\":\"https:\/\/www.wsisp.com\/helps\/\",\"name\":\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"description\":\"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"contentUrl\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"caption\":\"admin\"},\"sameAs\":[\"http:\/\/wp.wsisp.com\"],\"url\":\"https:\/\/www.wsisp.com\/helps\/author\/admin\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"MongoDB \u96c6\u5408\u6821\u9a8c\u5668\u4e2d $$NOW \u4e0d\u52a8\u6001\u6c42\u503c\u7684\u539f\u56e0\u4e0e\u66ff\u4ee3\u65b9\u6848 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.wsisp.com\/helps\/120742.html","og_locale":"zh_CN","og_type":"article","og_title":"MongoDB \u96c6\u5408\u6821\u9a8c\u5668\u4e2d $$NOW \u4e0d\u52a8\u6001\u6c42\u503c\u7684\u539f\u56e0\u4e0e\u66ff\u4ee3\u65b9\u6848 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u7ed9\u96c6\u5408\u52a0\u6821\u9a8c\u89c4\u5219\uff0c\u9650\u5236 joiningDate \u4e0d\u5f97\u665a\u4e8e\"\u5f53\u524d\u65f6\u95f4\"\uff0c\u5199\u51fa\u6765\u5f88\u81ea\u7136\uff1a$jsonSchema \u7ba1\u7c7b\u578b\uff0c$expr \u914d\u5408 $$NOW \u7ba1\u65f6\u5e8f\u3002\u5b9e\u9645\u8fd0\u884c\u5374\u53d1\u73b0\u6821\u9a8c\u50cf\u662f\u88ab\u51bb\u7ed3\u5728\u4e86\u521b\u5efa\u96c6\u5408\u7684\u90a3\u4e00\u523b\u2014\u2014\u6bd4\u521b\u5efa\u65f6\u523b\u65e9\u7684\u65e5\u671f\u80fd\u901a\u8fc7\uff0c\u6bd4\u521b\u5efa\u65f6\u523b\u665a\u7684\u65e5\u671f\u53cd\u800c\u88ab\u62d2\u7edd\u3002 \u95ee\u9898\u73b0\u8c61 \u521b\u5efa\u96c6\u5408\u65f6\u7684\u6821\u9a8c\u5668\uff1a db.createCollection(\"employees\", {validator: {$and","og_url":"https:\/\/www.wsisp.com\/helps\/120742.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2026-10-31T23:40:36+00:00","author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/120742.html","url":"https:\/\/www.wsisp.com\/helps\/120742.html","name":"MongoDB \u96c6\u5408\u6821\u9a8c\u5668\u4e2d $$NOW \u4e0d\u52a8\u6001\u6c42\u503c\u7684\u539f\u56e0\u4e0e\u66ff\u4ee3\u65b9\u6848 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2026-10-31T23:40:36+00:00","dateModified":"2026-10-31T23:40:36+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/120742.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/120742.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/120742.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"MongoDB \u96c6\u5408\u6821\u9a8c\u5668\u4e2d $$NOW \u4e0d\u52a8\u6001\u6c42\u503c\u7684\u539f\u56e0\u4e0e\u66ff\u4ee3\u65b9\u6848"}]},{"@type":"WebSite","@id":"https:\/\/www.wsisp.com\/helps\/#website","url":"https:\/\/www.wsisp.com\/helps\/","name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","description":"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41","name":"admin","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/","url":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","contentUrl":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","caption":"admin"},"sameAs":["http:\/\/wp.wsisp.com"],"url":"https:\/\/www.wsisp.com\/helps\/author\/admin"}]}},"_links":{"self":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/120742","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/comments?post=120742"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/120742\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=120742"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=120742"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=120742"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=120742"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}