This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-10-04
Channels
- # aleph (10)
- # announcements (2)
- # babashka (2)
- # beginners (101)
- # calva (17)
- # cider (11)
- # clara (6)
- # clj-kondo (25)
- # cljsrn (33)
- # clojure (181)
- # clojure-dev (15)
- # clojure-europe (3)
- # clojure-italy (4)
- # clojure-nl (8)
- # clojure-uk (22)
- # clojurescript (111)
- # clojutre (58)
- # cursive (31)
- # data-science (1)
- # datomic (10)
- # emacs (6)
- # ethereum (1)
- # fulcro (20)
- # graalvm (3)
- # jackdaw (5)
- # leiningen (5)
- # off-topic (31)
- # re-frame (2)
- # reitit (10)
- # shadow-cljs (9)
- # spacemacs (16)
- # sql (8)
- # tools-deps (16)
- # vim (17)
(let [schema [{:db/ident :foo/checked?
:db/valueType :db.type/boolean
:db/cardinality :db.cardinality/one}
{:db/ident :foo/id
:db/valueType :db.type/string
:db/unique :db.unique/identity
:db/cardinality :db.cardinality/one}]
{:keys [db-after]} (d/with (d/with-db @user/conn) {:tx-data schema})
{:keys [db-after]} (d/with db-after {:tx-data [{:foo/id "ok"
:foo/checked? true}
{:foo/id "not-ok"}]})]
{:ok (d/pull db-after {:eid [:foo/id "ok"]
:selector '[:db/id
(:foo/checked? :default false)]})
:not-ok (d/pull db-after {:eid [:foo/id "not-ok"]
:selector '[:db/id
(:foo/checked? :default false)]})
:not-ok-42 (d/pull db-after {:eid [:foo/id "not-ok"]
:selector '[:db/id
(:foo/checked? :default 42)]})})
=>
{:ok {:db/id 60332402039328370, :foo/checked? true},
:not-ok {:db/id 65148262968987251, :foo/id "not-ok"},
:not-ok-42 {:db/id 65148262968987251, :foo/checked? 42}}
There is a bug in datomic/pull default-option
https://docs.datomic.com/cloud/query/query-pull.html#default-option
Should I open a "formal" ticket in
or this report is enough?It's just to confirm that the issue is with false
value: once it work with the value 42
, everything else inside the test scenario is ok. @ghadi
For me it clarifies that the issue is related to :default false
and *not* related to :default with boolean atribute
or even you are using a old version of datomic that not support default