Is there a way to visit a node by id?

ok, this is weird, i have been using org-roam for several years… but today I wanted to write a function to visit a specific node.

Is there a function to visit a specific node-id in org-roam? I could not find any.

thank you in advance

P.s. there org-id-open but that does not use the database

(defalias 'org-roam-id-open 'org-id-open
    "Obsolete alias - use `org-id-open' directly.")

I suggest to look at a previous version of the source for this function. It used to use DB and was standardized in recent version updates.

What’s the reason behind your motivation?

Thanks. I’ll do that

I want to create a small command/function that visits the node (there is a small set of nodes I visit all the time and I don’t want to use org-roam-node-find any more). I can open the file, but I thought that the node-id will be better, in case I move the file (and also, puts the point at the beginning of the node).

Thought the built-in org-id-open would be enough for your purpose, though it does not use DB. Some reason to prefer DB to the built-in way (with a list in a file)?

Fear, uncertainty and doubt :slight_smile:

I use syncthing to sync all my files from computer to computer. The IDs in org-cache seems to be updated only when the files are opened in the computer where the cache exists.

In contrast, I run org-roam-db-sync daily (or when a file does not seem to be found). So I trust org-roam’s db more than org’s cache.

I don’t really know if this is an issue, in part because I never understood org’s cache (the documentation on it is not very good).

Oh, I see. I am not sure of the timing of Org ID cache either :slight_smile:

ok, i got help from chatGPT. this function seems to update org-ids by scanning org-roam files:

org-roam-update-org-id-locations

which calls

org-id-update-id-locations with a list of files

so i guess if I call org-roam-update-org-id-location I should be ok

I use org-id-goto for this.