Skip to content

Conversation

@klirix
Copy link

@klirix klirix commented Nov 23, 2024

  • Adds examples of Basic session API for MongoDB
  • Lists it on the pages listing examples

With some differences in data structuring in SQL vs NoSQL, I embedded the session documents into user documents. This way we only need one operation per update and one operation for fetching both user and the session

Ideally the user and session object wouldn't be separated, as in DB they exist embedded together, but in order to conform to API's down the line that would rely on separate session and user object I splitted them up

And since the userId field in session is not used in application code, but only exists in the DB for joins, I ommited that field for unnecessary redundancy

I used sqlite as a base doc. Should be fine

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant