Get all fields from a Datomic entity

后端 未结 5 1901
灰色年华
灰色年华 2021-02-01 05:01

The \'Embedded\' section of the Datomic Queries and Rules document says:

Query languages like SQL are oriented around a client-server model where, in a

5条回答
  •  傲寒
    傲寒 (楼主)
    2021-02-01 05:31

    You can use pull to get all fields from an entity, or even just a selection. Using '[*] as the pattern for pull will retrieve all fields

    See the pull documentation for more information.

    To get all fields from an entity with id eid use:

    (d/pull (db conn) '[*] eid)

    Pull can also be used in queries:

    (datomic.api/q '[:find (pull ?e [*])
                     :where
                     [?e :myapp/name]
                   (db conn))
    

提交回复
热议问题