<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
xmlns:content="http://purl.org/rss/1.0/modules/content/"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
xmlns:atom="http://www.w3.org/2005/Atom"
xmlns:wfw="http://wellformedweb.org/CommentAPI/">
<channel>
<title>dwt&#039;s life - mongodb</title>
<link>https://dwt.life/tag/mongodb/</link>
<atom:link href="https://dwt.life/feed/tag/mongodb/" rel="self" type="application/rss+xml" />
<language>zh-CN</language>
<description></description>
<lastBuildDate>Mon, 14 Feb 2022 01:29:03 +0800</lastBuildDate>
<pubDate>Mon, 14 Feb 2022 01:29:03 +0800</pubDate>
<item>
<title>Mongdb非空数组查询</title>
<link>https://dwt.life/archives/191/</link>
<guid>https://dwt.life/archives/191/</guid>
<pubDate>Mon, 14 Feb 2022 01:29:03 +0800</pubDate>
<dc:creator>Ricky</dc:creator>
<description><![CDATA[db.idap_zl.insert({array:[]})db.idap_zl.insert({array:[1,2,3,4,5]})db.idap_zl.find({array:{$elemM...]]></description>
<content:encoded xml:lang="zh-CN"><![CDATA[
<p>db.idap_zl.insert({array:[]})</p><p>db.idap_zl.insert({array:[1,2,3,4,5]})</p><p>db.idap_zl.find({array:{$elemMatch:{$ne:null}}})</p><h1>一、elemMatch和elemMatch和ne</h1><p><code>db.Collection.find({array:{$elemMatch:{$ne:null}}})</code></p><h1>二、$where</h1><p><code>db.Collection.find({$where:&quot;this.array.length&gt;0&quot;})</code></p><h1>三、not和not和size</h1><p><code>db.Collection.find({array: {$not: {$size: 0}}})</code></p><h1>四、'.'路径和$exists</h1><p><code>db.Collection.find({{&#039;array.0&#039;: {$exists: 1}}})</code></p><h1>五、exists和exists和ne</h1><p><code>db.Collection.find({ array: { $exists: true, $ne: [] } })</code></p><h1>六、$gt</h1><p><code>db.Collection.find({ array: { $gt: [] } })</code></p>
]]></content:encoded>
<slash:comments>0</slash:comments>
<comments>https://dwt.life/archives/191/#comments</comments>
<wfw:commentRss>https://dwt.life/feed/tag/mongodb/</wfw:commentRss>
</item>
</channel>
</rss>