<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
<channel>
<title>Datomic Knowledgebase - Recent questions tagged pull query</title>
<link>https://ask.datomic.com/index.php/tag/pull%20query</link>
<description>Powered by Question2Answer</description>
<item>
<title>Why is the pull pattern for wild card giving me an error?</title>
<link>https://ask.datomic.com/index.php/984/why-is-the-pull-pattern-for-wild-card-giving-me-an-error</link>
<description>&lt;p&gt;I am having an issue with a query and wild card patterns:&lt;br&gt;
(d/q {:query &#039;[:find (pull ?page pattern)&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;                         :in $ ?id pattern
                         :where
                         [?page :page/id ?id]]
                  :args [(d/db conn)
                         id
                         &#039;[*]]})
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;It gives me an error:&lt;br&gt;
 Attribute identifier clojure.core/* of class: class java.lang.String does not start with a colon&lt;br&gt;
Any idea why it doesn&#039;t work? I also tried adding the pattern directly to the pull expression, but I get the exact same issue&lt;/p&gt;
</description>
<category>On-Prem</category>
<guid isPermaLink="true">https://ask.datomic.com/index.php/984/why-is-the-pull-pattern-for-wild-card-giving-me-an-error</guid>
<pubDate>Wed, 31 Jan 2024 16:27:11 +0000</pubDate>
</item>
<item>
<title>How to get io-stats from pull and pull-many?</title>
<link>https://ask.datomic.com/index.php/876/how-to-get-io-stats-from-pull-and-pull-many</link>
<description>&lt;p&gt;I tried looking here but it doesn&#039;t seem to be documented &lt;a rel=&quot;nofollow&quot; href=&quot;https://docs.datomic.com/on-prem/clojure/index.html&quot;&gt;https://docs.datomic.com/on-prem/clojure/index.html&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;I was able to get the io-stats from query, thanks to an example on this page: &lt;a rel=&quot;nofollow&quot; href=&quot;https://docs.datomic.com/on-prem/api/io-stats.html#query&quot;&gt;https://docs.datomic.com/on-prem/api/io-stats.html#query&lt;/a&gt;&lt;/p&gt;
</description>
<category>Peer API</category>
<guid isPermaLink="true">https://ask.datomic.com/index.php/876/how-to-get-io-stats-from-pull-and-pull-many</guid>
<pubDate>Wed, 08 Mar 2023 15:04:12 +0000</pubDate>
</item>
<item>
<title>Inconsistency between d/pull and d/q + pull for non-existent entities</title>
<link>https://ask.datomic.com/index.php/860/inconsistency-between-pull-and-pull-for-existent-entities</link>
<description>&lt;p&gt;Inconsistency between d/pull and d/q + pull for non-existent entities&lt;/p&gt;
&lt;p&gt;Datomic returns a map with the &lt;code&gt;:db/id&lt;/code&gt; of the entity being pulled, even if the entity doesn&#039;t exist in the database. For example:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;(d/pull (d/db conn) &#039;[*] 9999999999)
=&amp;gt; #:db{:id 9999999999}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;This behavior is somewhat confusing, especially when using &lt;code&gt;d/pull&lt;/code&gt; with time filters. I was expecting &lt;code&gt;d/pull&lt;/code&gt; to return &lt;code&gt;nil&lt;/code&gt; or &lt;code&gt;#:db{:id nil}&lt;/code&gt; if the entity wasn&#039;t created at the given point in time. However, Datomic always returns a map with the entity ID:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;(d/pull (as-of (d/db conn) 1) &#039;[*] 9999999999)
=&amp;gt; #:db{:id 9999999999}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Surprisingly, I see the expected behavior if I pull the entity information from a query using &lt;code&gt;d/q&lt;/code&gt;:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;(d/q &#039;{:find [(pull ?e [*])]
        :in   [?e]}
      (d/db conn) 9999999999)
=&amp;gt; [[#:db{:id nil}]]
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Is that difference in behavior expected? How can I determine if an entity existed at any point in time using &lt;code&gt;d/pull&lt;/code&gt;?&lt;/p&gt;
</description>
<category>Cloud</category>
<guid isPermaLink="true">https://ask.datomic.com/index.php/860/inconsistency-between-pull-and-pull-for-existent-entities</guid>
<pubDate>Sat, 10 Dec 2022 15:55:29 +0000</pubDate>
</item>
</channel>
</rss>