Reputation: 228
I know how to save a list of String
Now, e.g. I create my own Animal class
But when I try to save list in mongodb, it gives
java.lang.IllegalArgumentException: can't serialize class Project
I do create a new mongo collection Animal, but it is still not working.
Upvotes: 1
Views: 1166
Reputation: 26012
If Animal class extend ReflectionDBObject then you can insert list of Animals.
Animal extends ReflectionDBObject {
}
Upvotes: 1
Reputation: 33145
You might check out Morphia or similar, where you can create object models and save them directly to Mongo.
http://code.google.com/p/morphia/
Upvotes: 1