Datomic チュートリアルをいじるときに一つ注意して欲しい点があります。
それは、ドキュメントとチュートリアルで読み込むスキーマ定義用のednファイル(seattle-schema.edn)ファイルに一部異なるところがあるからです(datomic-free-0.9.5153.zipで確認)。
異なる点があるのは:community/type
のカーディナリティです。
ドキュメントでは次のように定義されています。
attribute | type | cardinality |
---|---|---|
:community/type |
Reference | One |
しかし、seattle-schema.edn
ファイルでは:community/type
のカーディナリティがmanyで定義されています。
{:db/id #db/id[:db.part/db] :db/ident :community/type :db/valueType :db.type/ref :db/cardinality :db.cardinality/many :db/doc "Community type enum values" :db.install/_attribute :db.part/db}
もし、ドキュメントと同じ条件でチュートリアルをやりたい人は、seattle-schema.edn
のカーディナリティを:db.cardinality/one
に修正して実行するとよいでしょう。
If you want to try datomic tutorial, please note that there is miss definition in seattle-schema.edn
(at the version of datomic-free-0.9.5153.zip).
In the tutorial document, :community/type
is defined as :db.cardinality/one
attribute | type | cardinality |
---|---|---|
:community/type |
Reference | One |
But in seattle-schema.edn
, the cardinality of :community/type
is defined as :db.cardinality/many
.
{:db/id #db/id[:db.part/db] :db/ident :community/type :db/valueType :db.type/ref :db/cardinality :db.cardinality/many :db/doc "Community type enum values" :db.install/_attribute :db.part/db}
If you wanna try tutorial in the same condition as document, you should edit seattle-schema.edn
.