persist objects with MongoDB