How do I serialize/de-serialize data with embedded documents?
155 views
Skip to first unread message
dblock
unread,
Feb 13, 2011, 9:58:43 AM2/13/11
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Mongoid
I'm trying to write an export/import for data with Rake, currently
using to_json and from_json.
I see two problems when doing this:
object = model.new.from_json line
object.save!
1) If the object already exists in the database, MongoID tries to
insert a dup. How do I update this data?
2) I am missing embedded documents. Is there a way to serialize the
entire thing?
Thx
-dB.
dblock
unread,
Feb 13, 2011, 2:41:14 PM2/13/11
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Mongoid
Please ignore 2), my mistake.
Durran Jordan
unread,
Feb 14, 2011, 10:26:24 AM2/14/11
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message