Fork me on GitHub
#datascript
<
2022-02-20
>
Saurabh06:02:16

I’m trying to use datascript from vanilla JS to read my Roam Research export EDN file. However, when I try to run a basic query it fails with Error: Cannot compare :block/uid to :node/title. The exact same query works in Datascript in Clojurescript. Here’s the exact code: https://gist.github.com/saurabhsharan/7f65765713a7c96f3e60acd8987d61ba Any ideas? Thanks!

lilactown16:02:53

the gist of it is: jsedn.parse converts keywords to strings, and datascript leaves them as strings. so in your query, you'll need to surround your attributes in quotes so that datascript knows to compare them as strings

Saurabh23:02:43

Ah, thanks so much @U4YGF4NGM that fixed it perfectly! Cheers!

🎉 1