Fork me on GitHub
#datascript
<
2021-10-28
>
joost-diepenmaat12:10:56

I’m experiencing unexpected results. I’ve got a small database that returns a map with unrelated attributes from a pull (including :db/id nil) - when I try to pull with a db.unique/identity selector.

joost-diepenmaat12:10:26

(d/pull @conn '[*] [:endpoint/name "none"])

joost-diepenmaat12:10:47

{:access/endpoint #:db{:id 37}, :access/app+endpoint [36 37], :access/app #:db{:id 36}, :app/password-hash "5e063ba6dcff4b7bc0234be7861dac8c4dd7db573f36755e0578b2e77a5cf6bf", :endpoint/url "", :path/spec "/", :endpoint/proxy-options {:auth "fred:wilma"}, :access/paths [#:db{:id 1} #:db{:id 10} #:db{:id 11} #:db{:id 1} #:db{:id 1} #:db{:id 1} #:db{:id 3} #:db{:id 25} #:db{:id 1} #:db{:id 10} #:db{:id 11} #:db{:id 1} #:db{:id 10} #:db{:id 11}], :app/name "bubbles", :endpoint/name "Basic.Auth.Backend", :db/id nil, :app/password-salt "5970ad7d7501916274cf114f68d2aed0"}

joost-diepenmaat12:10:19

note that :endpoint/name is defined as :endpoint/name {:db/unique :db.unique/identity}

joost-diepenmaat12:10:53

and there is no entity with endpoint/name “none”

joost-diepenmaat12:10:16

if I do (d/pull @conn '[:endpoint/name :db/id] [:endpoint/name "none"]) I get the expected result: nil

joost-diepenmaat12:10:49

so the difference in the query the [*] vs a list of attributes in the pull spec

joost-diepenmaat12:10:29

Any hints as to what I’m doing wrong?