mongokit modification request: embedding an object in a document using SchemaDocument

33 views
Skip to first unread message

Hervé Ménager

unread,
Dec 19, 2013, 7:04:11 AM12/19/13
to mong...@googlegroups.com, Bertrand Néron
Hi,

This email is a follow-up to a few questions and discussions that have
taken place in this group. The most descriptive of then is by Shahaf
Abileah, "Best practice for embedding an object in a document"
(https://groups.google.com/forum/#!topic/mongokit/9_uinwkY6pQ).
This is also highly related to issues subsequently created in the
mongokit project:
https://github.com/namlook/mongokit/issues/156
https://github.com/namlook/mongokit/issues/157
Other previous discussions include:
https://groups.google.com/forum/#!topic/mongokit/110IunJSRxk
https://groups.google.com/forum/#!topic/mongokit/83B5gFZF34k
https://groups.google.com/forum/#!topic/mongokit/8TKSidv9nGs

First, let me put this into context. We are currently using mongokit
to develop a python web-based application that stores its data in
Mongo. We use Mongo because:
1) it allows to store potentially deeply nested documents
2) JSON format is easily usable in web applications
We have data structures in this project which are extremely similar to
what documents are (i.e., JSON structures), but are not tied to a
particular collection, and can be embedded in multiple documents. This
is really important in our case, because if we were to reference these
structure as mere Document objects the number and nesting degree of
the embedded documents would mean that the retrieval of a single
document would require many mongo requests instead of one.

What we have done is we forked the mongokit project
(https://github.com/mobyle2/mongokit) to test the feasability of the
following modification:
- create embedded documents as SchemaDocument subclasses,
- ensure their type is correctly re-instanciated when querying data
from Mongo (this is using a mechanism quite similar to the use of
"_type" field for "inherited queries"
(https://github.com/namlook/mongokit/wiki/Inherited-queries).

Would it be possible to integrate the modifications we made to
mongokit main repo (https://github.com/namlook/mongokit)?

Cheers,
Hervé Ménager and Bertrand Néron
Reply all
Reply to author
Forward
0 new messages