# :as is ignored for :db/id in pull expressions

**URL:** <https://forum.datomic.com/t/as-is-ignored-for-db-id-in-pull-expressions/1731>\
**Category:** General\
**Created:** [January 4, 2021, 6:19pm UTC](https://forum.datomic.com/t/as-is-ignored-for-db-id-in-pull-expressions/1731 "2021-01-04T18:19:38Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![nikolayandr](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.datomic.com/nikolayandr/32/375_2.png) [@nikolayandr](https://forum.datomic.com/u/nikolayandr)\
**Post date:** [January 4, 2021, 6:19pm UTC](https://forum.datomic.com/t/as-is-ignored-for-db-id-in-pull-expressions/1731/1 "2021-01-04T18:19:39Z")

</div>

If to execute the next query:

```
(d/q '[:find
 [(pull ?User [[:db/id :as "id2"][:User/bigDec :as "bigDec2"]]) ...]
 :in
 $
 :where

 [?User :User/bigDec _]
]
(d/db conn))

```

then the result is:

`[{:db/id 17592186045418, "bigDec2" 3.02M} {:db/id 17592186045421, "bigDec2" 3.020M} {:db/id 17592186045423, "bigDec2" 3.020M}]`

We see that maps contain **:db/id** instead of **“id2”** , is it expected result or I’m doing something wrong? Thanks

---

<div class="post-metadata">

**Author:** ![jaret](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.datomic.com/jaret/32/45_2.png) [@jaret](https://forum.datomic.com/u/jaret)\
**Post date:** [January 5, 2021, 4:10pm UTC](https://forum.datomic.com/t/as-is-ignored-for-db-id-in-pull-expressions/1731/2 "2021-01-05T16:10:33Z")

</div>

Hi @nikolayandr, `db/id` is special, but I see how this is inconsistent behavior and we either need to adjust this behavior to allow for aliasing or specify in the docs that `db/id` can not be aliased. I need to discuss this issue with the team and confirm what the correct course here is. I’ll update you as we’ve had a chance to review.

---

<div class="post-metadata">

**Author:** ![onetom](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.datomic.com/onetom/32/430_2.png) [@onetom](https://forum.datomic.com/u/onetom)\
**Post date:** [June 27, 2024, 6:22am UTC](https://forum.datomic.com/t/as-is-ignored-for-db-id-in-pull-expressions/1731/3 "2024-06-27T06:22:21Z")

</div>

I just needed this feature again today.

We are exposing our entity ids in denormalized Excel and Google Sheets spreadsheets and it would help the spreadsheet template developers, if they could see `:account/eid` - as in Entity ID - alongside with the `:account/id`, which is the accounting system’s own ID.

We would like to apply this convention system wide, so it would be really convenient, if we could take care of this declaratively.

That being said, it would also be nice, if we could pull an attribute both with their original name and with an alias, eg.

```clojure
[:qb.account/id
 [:qb.account/id :as :account/id]]

```

which throws

```clojure
Execution error (ExceptionInfo) at datomic.core.error/raise (error.clj:55).
:pull/duplicate-attribute Multiple specifications for :qb.account/id

```

currently.

---

<div class="post-metadata">

**Author:** ![nikolayandr](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.datomic.com/nikolayandr/32/375_2.png) [@nikolayandr](https://forum.datomic.com/u/nikolayandr)\
**Post date:** [August 2, 2024, 6:32am UTC](https://forum.datomic.com/t/as-is-ignored-for-db-id-in-pull-expressions/1731/4 "2024-08-02T06:32:15Z")

</div>

> [@jaret](#):
>
> db/id can not be aliased

Hi @jaret. Could you please tell me whether there is any decision on how :db/id might be treated(`either need to adjust this behavior to allow for aliasing or specify in the docs that db/id can not be aliased`) in pull expressions?
