简体   繁体   中英

Save list in mongodb using grails

im new to mongodb so a little confused on how do i save the list object in mongodb using grails, basically i have a list of hasmap , which is in turn is a string,list map , like this

List<HashMap<String, ArrayList<Object>>> changedProperties = new ArrayList<HashMap<String, ArrayList<Object>>>()

and here is my domain class that have this type of property

class DatabaseEvent {

String type
String entityClass
String objectId
Date dateCreated
User loggedInUser
List<HashMap<String, ArrayList<Object>>> changedProperties
}

if i simply pass this type of list , it is not saving.

[[description:[null, some test]], [name:[Testing 12, Testing 1]], [displayOrder:[4, 11]]]

im passing the above list , but it rejects with this error

rejected value [[{description=[null, some test]}, {name=[Testing 12, Testing 1]}, {displayOrder=[4, 11]}]] 

Check out this link.

Grails in the Land of MongoDB

http://blog.mongodb.org/post/18510469058/grails-in-the-land-of-mongodb

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM