Skip to content

Conversation

@nailgun
Copy link
Contributor

@nailgun nailgun commented Dec 21, 2012

There is no need to limit users of Grid.get and Grid.delete to use only ObjectID identifiers. In any other places you can use object of any type as identifier (such as int, string, etc).

@christkv
Copy link
Contributor

please add a test showing that it works and fix any breaking tests.

@nailgun
Copy link
Contributor Author

nailgun commented Dec 24, 2012

Ok

@nailgun
Copy link
Contributor Author

nailgun commented Dec 24, 2012

I started to write new tests. But I have found that problem is deeper than I think - there is no way to allow GridStore object to accept file_id not type of ObjectID without breaking the API. This is because GridStore constructor checks type of id, and if it isn't ObjectID, it is considered as filename.
But documentation doesn't mention id as optional argument. So there is disagreement within documentation and driver code.

If we change id to mandatory, this can break existing code, that depends to driver, but driver code will follow existing documentation. If we would not, driver allow access grid files using only ObjectID identifiers in contrast to normal mongodb records, that can be accessed by id of any type.

I can update code, tests and send push request.

@nailgun
Copy link
Contributor Author

nailgun commented Dec 26, 2012

I have found a way to do things almost backward compatible. This is my new request: #825
Current request can be closed.

@nailgun nailgun closed this Dec 26, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants