{"id":3081,"date":"2015-04-21T13:15:24","date_gmt":"2015-04-21T10:15:24","guid":{"rendered":"http:\/\/www.webcodegeeks.com\/?p=3081"},"modified":"2015-04-21T12:49:09","modified_gmt":"2015-04-21T09:49:09","slug":"pymongo-key-order-subdocuments","status":"publish","type":"post","link":"https:\/\/www.webcodegeeks.com\/python\/pymongo-key-order-subdocuments\/","title":{"rendered":"PyMongo And Key Order In Subdocuments"},"content":{"rendered":"<p><em>Or,<\/em> &quot;Why does my query work in the shell but not PyMongo?&quot;<\/p>\n<p>Variations on this question account for a large portion of the Stack Overflow questions I see about PyMongo, so let me explain once for all.<\/p>\n<p>MongoDB stores documents in a binary format called <a href=\"http:\/\/bsonspec.org\/\">BSON<\/a>. Key-value pairs in a BSON document can have any order (except that <code>_id<\/code> is always first).<\/p>\n<p>The mongo shell preserves key order when reading and writing data. Observe that &quot;b&quot; comes before &quot;a&quot; when we create the document and when it is displayed:<\/p>\n<pre class=\"brush: php; title: ; notranslate\" title=\"\">&gt; \/\/ mongo shell.\r\n&gt; db.collection.insert( {\r\n...     '_id' : 1,\r\n...     'subdocument' : { 'b' : 1, 'a' : 1 }\r\n... } )\r\nWriteResult({ 'nInserted' : 1 })\r\n&gt; db.collection.find()\r\n{ '_id' : 1, 'subdocument' : { 'b' : 1, 'a' : 1 } }<\/pre>\n<p>PyMongo represents BSON documents as Python dicts by default, and the order of keys in dicts is not defined. That is, a dict declared with the &quot;a&quot; key first is the same, to Python, as one with &quot;b&quot; first:<\/p>\n<pre class=\"brush: php; title: ; notranslate\" title=\"\">&gt;&gt;&gt; print {'a': 1.0, 'b': 1.0}\r\n{'a': 1.0, 'b': 1.0}\r\n&gt;&gt;&gt; print {'b': 1.0, 'a': 1.0}\r\n{'a': 1.0, 'b': 1.0}<\/pre>\n<p>Therefore, Python dicts are not guaranteed to show keys in the order they are stored in BSON. Here, &quot;a&quot; is shown before &quot;b&quot;:<\/p>\n<pre class=\"brush: php; title: ; notranslate\" title=\"\">&gt;&gt;&gt; print collection.find_one()\r\n{u'_id': 1.0, u'subdocument': {u'a': 1.0, u'b': 1.0}}<\/pre>\n<p>To preserve order when reading BSON, use the <code>SON<\/code> class, which is a dict that remembers its key order. First, get a handle to the collection, configured to use <code>SON<\/code> instead of dict. In <a href=\"http:\/\/emptysqua.re\/blog\/pymongo-3-beta\/\">PyMongo 3.0<\/a> do this like:<\/p>\n<pre class=\"brush: php; title: ; notranslate\" title=\"\">&gt;&gt;&gt; from bson import CodecOptions, SON\r\n&gt;&gt;&gt; opts = CodecOptions(as_class=SON)\r\n&gt;&gt;&gt; opts\r\nCodecOptions(as_class=&lt;class 'bson.son.SON'&gt;,\r\n             tz_aware=False,\r\n             uuid_representation=PYTHON_LEGACY)\r\n&gt;&gt;&gt; collection_son = collection.with_options(codec_options=opts)<\/pre>\n<p>Now, documents and subdocuments in query results are represented with <code>SON<\/code> objects:<\/p>\n<pre class=\"brush: php; title: ; notranslate\" title=\"\">&gt;&gt;&gt; print collection_son.find_one()\r\nSON(&#x5B;(u'_id', 1.0), (u'subdocument', SON(&#x5B;(u'b', 1.0), (u'a', 1.0)]))])<\/pre>\n<p>The subdocument&#8217;s actual storage layout is now visible: &quot;b&quot; is before &quot;a&quot;.<\/p>\n<p>Because a dict&#8217;s key order is not defined, you cannot predict how it will be serialized <strong>to<\/strong> BSON. But MongoDB considers subdocuments equal only if their keys have the same order. So if you use a dict to query on a subdocument it may not match:<\/p>\n<pre class=\"brush: php; title: ; notranslate\" title=\"\">&gt;&gt;&gt; collection.find_one({'subdocument': {'a': 1.0, 'b': 1.0}}) is None\r\nTrue<\/pre>\n<p>Swapping the key order in your query makes no difference:<\/p>\n<pre class=\"brush: php; title: ; notranslate\" title=\"\">&gt;&gt;&gt; collection.find_one({'subdocument': {'b': 1.0, 'a': 1.0}}) is None\r\nTrue<\/pre>\n<p>&#8230; because, as we saw above, Python considers the two dicts the same.<\/p>\n<p>There are two solutions. First, you can match the subdocument field-by-field:<\/p>\n<pre class=\"brush: php; title: ; notranslate\" title=\"\">&gt;&gt;&gt; collection.find_one({'subdocument.a': 1.0,\r\n...                      'subdocument.b': 1.0})\r\n{u'_id': 1.0, u'subdocument': {u'a': 1.0, u'b': 1.0}}<\/pre>\n<p>The query matches any subdocument with an &quot;a&quot; of 1.0 and a &quot;b&quot; of 1.0, regardless of the order you specify them in Python or the order they are stored in BSON. Additionally, this query now matches subdocuments with additional keys besides &quot;a&quot; and &quot;b&quot;, whereas the previous query required an exact match.<\/p>\n<p>The second solution is to use a <code>SON<\/code> to specify the key order:<\/p>\n<pre class=\"brush: php; title: ; notranslate\" title=\"\">&gt;&gt;&gt; query = {'subdocument': SON(&#x5B;('b', 1.0), ('a', 1.0)])}\r\n&gt;&gt;&gt; collection.find_one(query)\r\n{u'_id': 1.0, u'subdocument': {u'a': 1.0, u'b': 1.0}}<\/pre>\n<p>The key order you use when you create a <code>SON<\/code> is preserved when it is serialized to BSON and used as a query. Thus you can create a subdocument that exactly matches the subdocument in the collection.<\/p>\n<p>For more info, see the <a href=\"http:\/\/docs.mongodb.org\/manual\/tutorial\/query-documents\/#embedded-documents\">MongoDB Manual entry on subdocument matching<\/a>.<br \/>\n<\/p>\n<div class=\"attribution\">\n<table>\n<tr>\n<td><span class=\"reference\">Reference: <\/span><\/td>\n<td><a href=\"http:\/\/emptysqua.re\/blog\/pymongo-key-order\/\">PyMongo And Key Order In Subdocuments<\/a> from our <a href=\"http:\/\/www.webcodegeeks.com\/wcg\/\">WCG partner<\/a> Jesse Davis at the <a href=\"http:\/\/emptysqua.re\/blog\/\">A. Jesse Jiryu Davis<\/a> blog.<\/td>\n<\/tr>\n<\/table>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Or, &quot;Why does my query work in the shell but not PyMongo?&quot; Variations on this question account for a large portion of the Stack Overflow questions I see about PyMongo, so let me explain once for all. MongoDB stores documents in a binary format called BSON. Key-value pairs in a BSON document can have any &hellip;<\/p>\n","protected":false},"author":29,"featured_media":1651,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[53],"tags":[57],"class_list":["post-3081","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-python","tag-mongodb"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>PyMongo And Key Order In Subdocuments - Web Code Geeks - 2026<\/title>\n<meta name=\"description\" content=\"Or, &quot;Why does my query work in the shell but not PyMongo?&quot; Variations on this question account for a large portion of the Stack Overflow\" \/>\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.webcodegeeks.com\/python\/pymongo-key-order-subdocuments\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"PyMongo And Key Order In Subdocuments - Web Code Geeks - 2026\" \/>\n<meta property=\"og:description\" content=\"Or, &quot;Why does my query work in the shell but not PyMongo?&quot; Variations on this question account for a large portion of the Stack Overflow\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.webcodegeeks.com\/python\/pymongo-key-order-subdocuments\/\" \/>\n<meta property=\"og:site_name\" content=\"Web Code Geeks\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/webcodegeeks\" \/>\n<meta property=\"article:published_time\" content=\"2015-04-21T10:15:24+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/11\/python-logo.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"150\" \/>\n\t<meta property=\"og:image:height\" content=\"150\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Jesse Davis\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@https:\/\/twitter.com\/jessejiryudavis\" \/>\n<meta name=\"twitter:site\" content=\"@webcodegeeks\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Jesse Davis\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.webcodegeeks.com\/python\/pymongo-key-order-subdocuments\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/python\/pymongo-key-order-subdocuments\/\"},\"author\":{\"name\":\"Jesse Davis\",\"@id\":\"https:\/\/www.webcodegeeks.com\/#\/schema\/person\/294d6819cb410ef55f273ecf25426c56\"},\"headline\":\"PyMongo And Key Order In Subdocuments\",\"datePublished\":\"2015-04-21T10:15:24+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/python\/pymongo-key-order-subdocuments\/\"},\"wordCount\":652,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/#organization\"},\"image\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/python\/pymongo-key-order-subdocuments\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/11\/python-logo.jpg\",\"keywords\":[\"MongoDB\"],\"articleSection\":[\"Python\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.webcodegeeks.com\/python\/pymongo-key-order-subdocuments\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.webcodegeeks.com\/python\/pymongo-key-order-subdocuments\/\",\"url\":\"https:\/\/www.webcodegeeks.com\/python\/pymongo-key-order-subdocuments\/\",\"name\":\"PyMongo And Key Order In Subdocuments - Web Code Geeks - 2026\",\"isPartOf\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/python\/pymongo-key-order-subdocuments\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/python\/pymongo-key-order-subdocuments\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/11\/python-logo.jpg\",\"datePublished\":\"2015-04-21T10:15:24+00:00\",\"description\":\"Or, &quot;Why does my query work in the shell but not PyMongo?&quot; Variations on this question account for a large portion of the Stack Overflow\",\"breadcrumb\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/python\/pymongo-key-order-subdocuments\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.webcodegeeks.com\/python\/pymongo-key-order-subdocuments\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.webcodegeeks.com\/python\/pymongo-key-order-subdocuments\/#primaryimage\",\"url\":\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/11\/python-logo.jpg\",\"contentUrl\":\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/11\/python-logo.jpg\",\"width\":150,\"height\":150},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.webcodegeeks.com\/python\/pymongo-key-order-subdocuments\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.webcodegeeks.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Python\",\"item\":\"https:\/\/www.webcodegeeks.com\/category\/python\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"PyMongo And Key Order In Subdocuments\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.webcodegeeks.com\/#website\",\"url\":\"https:\/\/www.webcodegeeks.com\/\",\"name\":\"Web Code Geeks\",\"description\":\"Web Developers Resource Center\",\"publisher\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.webcodegeeks.com\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.webcodegeeks.com\/#organization\",\"name\":\"Exelixis Media P.C.\",\"url\":\"https:\/\/www.webcodegeeks.com\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.webcodegeeks.com\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png\",\"contentUrl\":\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png\",\"width\":864,\"height\":246,\"caption\":\"Exelixis Media P.C.\"},\"image\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/webcodegeeks\",\"https:\/\/x.com\/webcodegeeks\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.webcodegeeks.com\/#\/schema\/person\/294d6819cb410ef55f273ecf25426c56\",\"name\":\"Jesse Davis\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.webcodegeeks.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/2db0fdaadd8cd6b86d93e1205e30dd3b43e3c46b91826513ab618934c3db8cf9?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/2db0fdaadd8cd6b86d93e1205e30dd3b43e3c46b91826513ab618934c3db8cf9?s=96&d=mm&r=g\",\"caption\":\"Jesse Davis\"},\"description\":\"Jesse is a senior engineer at MongoDB in New York City. He specializes in Python, MongoDB drivers, and asynchronous frameworks.\",\"sameAs\":[\"http:\/\/emptysqua.re\/blog\/\",\"https:\/\/x.com\/https:\/\/twitter.com\/jessejiryudavis\"],\"url\":\"https:\/\/www.webcodegeeks.com\/author\/jesse-davis\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"PyMongo And Key Order In Subdocuments - Web Code Geeks - 2026","description":"Or, &quot;Why does my query work in the shell but not PyMongo?&quot; Variations on this question account for a large portion of the Stack Overflow","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.webcodegeeks.com\/python\/pymongo-key-order-subdocuments\/","og_locale":"en_US","og_type":"article","og_title":"PyMongo And Key Order In Subdocuments - Web Code Geeks - 2026","og_description":"Or, &quot;Why does my query work in the shell but not PyMongo?&quot; Variations on this question account for a large portion of the Stack Overflow","og_url":"https:\/\/www.webcodegeeks.com\/python\/pymongo-key-order-subdocuments\/","og_site_name":"Web Code Geeks","article_publisher":"https:\/\/www.facebook.com\/webcodegeeks","article_published_time":"2015-04-21T10:15:24+00:00","og_image":[{"width":150,"height":150,"url":"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/11\/python-logo.jpg","type":"image\/jpeg"}],"author":"Jesse Davis","twitter_card":"summary_large_image","twitter_creator":"@https:\/\/twitter.com\/jessejiryudavis","twitter_site":"@webcodegeeks","twitter_misc":{"Written by":"Jesse Davis","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.webcodegeeks.com\/python\/pymongo-key-order-subdocuments\/#article","isPartOf":{"@id":"https:\/\/www.webcodegeeks.com\/python\/pymongo-key-order-subdocuments\/"},"author":{"name":"Jesse Davis","@id":"https:\/\/www.webcodegeeks.com\/#\/schema\/person\/294d6819cb410ef55f273ecf25426c56"},"headline":"PyMongo And Key Order In Subdocuments","datePublished":"2015-04-21T10:15:24+00:00","mainEntityOfPage":{"@id":"https:\/\/www.webcodegeeks.com\/python\/pymongo-key-order-subdocuments\/"},"wordCount":652,"commentCount":0,"publisher":{"@id":"https:\/\/www.webcodegeeks.com\/#organization"},"image":{"@id":"https:\/\/www.webcodegeeks.com\/python\/pymongo-key-order-subdocuments\/#primaryimage"},"thumbnailUrl":"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/11\/python-logo.jpg","keywords":["MongoDB"],"articleSection":["Python"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.webcodegeeks.com\/python\/pymongo-key-order-subdocuments\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.webcodegeeks.com\/python\/pymongo-key-order-subdocuments\/","url":"https:\/\/www.webcodegeeks.com\/python\/pymongo-key-order-subdocuments\/","name":"PyMongo And Key Order In Subdocuments - Web Code Geeks - 2026","isPartOf":{"@id":"https:\/\/www.webcodegeeks.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.webcodegeeks.com\/python\/pymongo-key-order-subdocuments\/#primaryimage"},"image":{"@id":"https:\/\/www.webcodegeeks.com\/python\/pymongo-key-order-subdocuments\/#primaryimage"},"thumbnailUrl":"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/11\/python-logo.jpg","datePublished":"2015-04-21T10:15:24+00:00","description":"Or, &quot;Why does my query work in the shell but not PyMongo?&quot; Variations on this question account for a large portion of the Stack Overflow","breadcrumb":{"@id":"https:\/\/www.webcodegeeks.com\/python\/pymongo-key-order-subdocuments\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.webcodegeeks.com\/python\/pymongo-key-order-subdocuments\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.webcodegeeks.com\/python\/pymongo-key-order-subdocuments\/#primaryimage","url":"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/11\/python-logo.jpg","contentUrl":"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/11\/python-logo.jpg","width":150,"height":150},{"@type":"BreadcrumbList","@id":"https:\/\/www.webcodegeeks.com\/python\/pymongo-key-order-subdocuments\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.webcodegeeks.com\/"},{"@type":"ListItem","position":2,"name":"Python","item":"https:\/\/www.webcodegeeks.com\/category\/python\/"},{"@type":"ListItem","position":3,"name":"PyMongo And Key Order In Subdocuments"}]},{"@type":"WebSite","@id":"https:\/\/www.webcodegeeks.com\/#website","url":"https:\/\/www.webcodegeeks.com\/","name":"Web Code Geeks","description":"Web Developers Resource Center","publisher":{"@id":"https:\/\/www.webcodegeeks.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.webcodegeeks.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.webcodegeeks.com\/#organization","name":"Exelixis Media P.C.","url":"https:\/\/www.webcodegeeks.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.webcodegeeks.com\/#\/schema\/logo\/image\/","url":"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","contentUrl":"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","width":864,"height":246,"caption":"Exelixis Media P.C."},"image":{"@id":"https:\/\/www.webcodegeeks.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/webcodegeeks","https:\/\/x.com\/webcodegeeks"]},{"@type":"Person","@id":"https:\/\/www.webcodegeeks.com\/#\/schema\/person\/294d6819cb410ef55f273ecf25426c56","name":"Jesse Davis","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.webcodegeeks.com\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/2db0fdaadd8cd6b86d93e1205e30dd3b43e3c46b91826513ab618934c3db8cf9?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/2db0fdaadd8cd6b86d93e1205e30dd3b43e3c46b91826513ab618934c3db8cf9?s=96&d=mm&r=g","caption":"Jesse Davis"},"description":"Jesse is a senior engineer at MongoDB in New York City. He specializes in Python, MongoDB drivers, and asynchronous frameworks.","sameAs":["http:\/\/emptysqua.re\/blog\/","https:\/\/x.com\/https:\/\/twitter.com\/jessejiryudavis"],"url":"https:\/\/www.webcodegeeks.com\/author\/jesse-davis\/"}]}},"_links":{"self":[{"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/posts\/3081","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/users\/29"}],"replies":[{"embeddable":true,"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/comments?post=3081"}],"version-history":[{"count":0,"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/posts\/3081\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/media\/1651"}],"wp:attachment":[{"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/media?parent=3081"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/categories?post=3081"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/tags?post=3081"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}