Comments (2)
I'm considering in do not implementing this issue. I think it should be in a level on top of mongodict
(let the developer do this work outside mongodict
). Summarizing possible problems:
- If
mongodict
tries automatically to pickle the object, it can lead to errors like outdated objects saved in the database (see the example below). - We'd need a kind of "protocol" to discover which objects are pickled and which are not. It can be a mess (imagine the collection with lots of non-homogeneous data, but with the same schema).
The problems involving pickled objects are exemplified below:
from mongodict import MongoDict
class MyClass(object):
pass
obj = MyClass()
obj.test = 123
my_dict = MongoDict()
my_dict['obj'] = obj
obj.python = 'rules'
assert my_dict['obj'] == obj # False
(I think) ZODB solves this problem forcing the developer to subclass a specific Persistent
class, so it'll update object info in the database when you update the object automatically but as mongodict
is not a object-oriented database, we can't force the developer to do it (maybe a library on top of mongodict
can do it).
It's open for discussion.
from mongodict.
Implemented on 194333f.
from mongodict.
Related Issues (12)
- OperationFailure: .... failed: exception: distinct too big, 16mb cap HOT 1
- Don't force utf-8 encoding
- Store objects using pickle HOT 1
- Run on Python's dict tests HOT 2
- Specify index type (key only or key + value)
- PyMongo 'Connection' API was changed in version 3 HOT 2
- Provide a memcached-like API HOT 1
- Optimize queries
- Use the same connection or collection object HOT 2
- Add expiration_date (use with TTL collections)
- Add authentication option
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mongodict.