Closed zaksnet closed 5 months ago
In JS, this is how we detect your entity collection: https://github.com/ravendb/ravendb-nodejs-client/blob/v5.4/src/Documents/Conventions/DocumentConventions.ts#L658
Basically, if you don't have a constructor
field (which JS provides for classes), you need to use the findCollectionNameForObjectLiteral
on the conventions to figure out what the type is.
Also this might be helpful: https://github.com/ravendb/ravendb-nodejs-client?tab=readme-ov-file#using-object-literals-for-entities
Thanks!
I am trying to build an adapter for Lucia but the DatabaseSession object is saved in the @empty collection.
I also saw this issue but i am already passing the object directly without explicitly defining an id. It is worth noting that the DatabaseSession interface is part of an external library and i have no control over it.
At first i though this might be due to the id being generated by
Lucia
instead of being null, but when i tried this:I still received the same result (I also checked in the debugger to see if the id is null, and it was.).
EDIT: This Worked. The session is saved in RavenDbDatabaseSession collection :
EDIT 2: That seemed to work: