DOCSP-45065: sessions documentation#3254
Merged
rustagir merged 4 commits intomongodb:5.xfrom Jan 29, 2025
Merged
Conversation
mongoKart
approved these changes
Jan 27, 2025
Contributor
mongoKart
left a comment
There was a problem hiding this comment.
straight 🔥
lgtm w/ a couple suggestions
GromNaN
reviewed
Jan 28, 2025
Member
GromNaN
left a comment
There was a problem hiding this comment.
LGTM once the index creation snippet is more adapted to Laravel.
Comment on lines
+85
to
+90
| .. code-block:: sh | ||
|
|
||
| db.sessions.createIndex( | ||
| { "expiry_field": 1 }, | ||
| { expireAfterSeconds: 0 } | ||
| ) |
Member
There was a problem hiding this comment.
The Laravel way to create this index is to use the Schema builder.
Schema::create('sessions', function (Blueprint $collection) {
$collection->expire('expiry_field', 0);
});
norareidy
approved these changes
Jan 29, 2025
GromNaN
reviewed
Jan 29, 2025
| .. code-block:: php | ||
|
|
||
| Schema::create('sessions', function (Blueprint $collection) { | ||
| $collection->expire('expiry_field', 0); |
Member
There was a problem hiding this comment.
You should use the actual field name, not the name of the option that contains the field name.
Since people would not customize the field names, this will prevent them from creating a useless index without noticing.
$collection->expire('expires_at', 0);
Contributor
Author
There was a problem hiding this comment.
Got it! as i understand, this is the name of the field that is stored in the session documents?
This was referenced Jan 29, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
https://jira.mongodb.org/browse/DOCSP-45065
Adds documentation for HTTP Sessions
Staging
Checklist