Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

strict type juggling proposal #36

Open
wants to merge 2 commits into
base: cake2.0
Choose a base branch
from

Conversation

aaronpeterson
Copy link

It seems like Model's typing is not sufficiently strict enough for a doc db? It appears to only cast date/time types. See my tests...if my schema the field "count" defined as in integer I only want it stored in mongo as an integer. Not a string.

@AD7six
Copy link
Contributor

AD7six commented Jan 10, 2012

If you are using mongo - you have to take responsibility for ensuring things are the right type on insert. see my comment here: https://github.com/ichikaway/cakephp-mongodb/issues/35#issuecomment-3427909

@AD7six
Copy link
Contributor

AD7six commented Jan 11, 2012

Incidentally,

In my own projects I would simply pass form data through a function to recurse on all values and cast int/floats as it found them. Relying on model schema to do it for you will mean any array/objects saved in your data will not have their values cast.

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.

3 participants