Skip to content
This repository has been archived by the owner on Jan 6, 2021. It is now read-only.

MongoDB Json #2

Open
henriqueoliveira opened this issue May 26, 2014 · 2 comments
Open

MongoDB Json #2

henriqueoliveira opened this issue May 26, 2014 · 2 comments

Comments

@henriqueoliveira
Copy link

On mongodb, the session data can be saved using Json, so we can view all the data with db.session.find() command.

Should be nice to have a field for Domain, than the session data will be separeted for each domain

If you need help, let me know, i can fork and do some stuff as pull request

Thanks

@msarca
Copy link
Member

msarca commented May 27, 2014

Is true that using JSON the data will become more human readable but the current implementation of the Mongo storage takes a general approach and makes no assumption regarding what kind of data a user will store into a session.

In most of the cases, users will store strings, numbers or arrays, but some users (and I'm one of them) might want to store other kind of data, like PHP objects or anonymous functions (using opis/closure).

I haven't tested yet, but i'm pretty sure that by using JSON we won't be able to store other data types beside strings, booleans, arrays, key-value dictionaries and numbers. Please, feel free to fork this repository if you would like to give it a try.

@henriqueoliveira
Copy link
Author

I Think that the MongoCollection::insert method will do the Job for you, not sure

http://www.php.net/manual/pt_BR/mongocollection.insert.php

But your answer is fare enought, i think there is no problem to keep this way

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants