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

Cannot set the _id field explicitly #16

Closed
unindented opened this issue Jul 20, 2010 · 0 comments
Closed

Cannot set the _id field explicitly #16

unindented opened this issue Jul 20, 2010 · 0 comments

Comments

@unindented
Copy link

This article on storage optimization talks about using the _id field explicitly to reduce storage space.

I have the following model:

class Game
  include Candy::Piece
end

When I try to do:

Game.new(_id: 1, name: 'Pong')

I get the error:

Mongo::OperationFailure: Mod on _id not allowed

Am I doing something wrong, or is this not supported by Candy? Is there a workaround?

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

No branches or pull requests

1 participant