-
Notifications
You must be signed in to change notification settings - Fork 2
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
jive-persistence-mongo is not compatible with the API of the default file persistence, it only accepts objects as data #2
Comments
jive-persistence-mongo doesn't have any tests and I don't see how to run jive-sdk tests with mongo persistence. The find function here has more capabilities than in file and memory persistence. |
Regarding tests:
|
File persistence API docs state that it takes data object. The API of both want data.
See also https://cdn.rawgit.com/jivesoftware/jive-sdk/master/docs/api/filePersistence.html |
Thanks. I don't know how I missed the tests :) So the take away from this is that all persistence implementations should check if data argument is an object. They don't do that right now and the error thrown comes from I'll make a pull request on monday with suggestions of error handling. |
Passing a string as
data
argument to thesave
method causes the implementation here to pass the string tocollection.update
which throws an error.if
jive-persistence-mongo
wants to support storing multiple data types, it needs to wrap the incoming data in a simple object.Otherwise, consistency should be provided to the users by making the simpler storages throw errors in the same cases.
The text was updated successfully, but these errors were encountered: