Questions tagged [gorm-mongodb]

A plugin that integrates the Mongo document datastore into Grails, providing a GORM API onto it

55 questions
34
votes
2 answers

Upgrading Grails MongoDB GORM broke projections on list properties

I am using Criteria with projections to get a list of tags on my Account domain. Like this: def tags = Account.createCriteria().list { projections { property("tags") } } My Account domain: class Account { static mapWith = "mongo" …
Haleystorm
  • 374
  • 2
  • 4
8
votes
1 answer

Can MongoDB store and manipulate strings of UTF-8 with code points outside the basic multilingual plane?

In MongoDB 2.0.6, when attempting to store documents or query documents that contain string fields, where the value of a string include characters outside the BMP, I get a raft of errors like: "Not proper UTF-16: 55357", or "buffer too small" What…
Eli
  • 227
  • 1
  • 3
  • 11
3
votes
1 answer

Grails Mongodb Embedded Documents ?Bug?

I have this simple model: abstract class Info { ObjectId id Date dateCreated Date lastUpdated } class Question extends Info { String title String content List answers = [] static embedded = ['answers'] } class…
3
votes
0 answers

Is there a replacement for GMongo in the Grails Gorm-MongoDB Plugin?

I am dealing with an extremely large code base that heavily uses the GMongo library to simplify access to the mongo database. As I understand, beginning with GORM for MongoDB 5.0, gmongo was removed. I now have a need to upgrade my mongo java…
3
votes
1 answer

A component required a bean named 'dataSource_dbCreate' that could not be found

I build web application on grails,groovy which is interacting with 3 DB's MySql,Oracle(temporarily poining to H2),Mongo. Inorder to create dataSource I configured below properties environments: development: dataSources: dbCreate:…
Raj
  • 173
  • 3
  • 9
2
votes
0 answers

Unable to save embedded objects in mongodb using gorm(typeMismatch error)

I am trying to create and save a domain object using gorm and mongodb plugin, but I always get type mismatch error on the embedded property("emailTemplates"). My domain is defined as : import org.apache.commons.mail.Email import…
Deewendra Shrestha
  • 2,313
  • 1
  • 23
  • 53
2
votes
0 answers

Grails: A field that is populated in beforeInsert not being persisted but persisted if populated by beforeValidate

I have a class X that extends AbstractDomain and has a field createdByUser. On AbstractDomain I have: Class AbstractDomain { ... def beforeInsert() { if(null != securityService) { User currentUser =…
Alexander Suraphel
  • 10,103
  • 10
  • 55
  • 90
2
votes
2 answers

How to use mongodb with grails 2.4.4?

I have been trying to use mongodb with grails. To do that add the following code in the plugin part in BuildConfig.groovy compile ":mongodb:3.0.3" Then I have changed DataSource.groovy into the follwings: grails { mongo { …
2
votes
0 answers

Integration test with fixtures in grails

In my Integration test, I have @Shared fields that are loaded from fixtures(Fixtures plugin for grails). Those fields are aliases for the fixture beans. Look at the code I have now! @TestFor(OrganizationUserService) class OrganizationUserServiceSpec…
Amanuel Nega
  • 1,899
  • 1
  • 24
  • 42
2
votes
0 answers

Grails w/ GORM MongoDB plugin: org.grails.datastore.mapping.core.OptimisticLockingException

I have a job that will run every few minutes, a new domain object is instantiated and populated with data from an api call, and then .save() is called to commit to the database. This application uses the GORM Mongo plugin. After deploying a new war…
Matt Rkiouak
  • 141
  • 7
2
votes
1 answer

How do you make a distinct query on GORM subdocument fields?

Given Grails 2.3.8 and Mongo 2.6.0, and this (simplified) domain class: db.account.findOne() { "name":"Test Account", "customer": { "state": "CA" } } where every account has a customer subdocument with a "state" string. To get…
Ed Norris
  • 4,233
  • 5
  • 27
  • 29
2
votes
1 answer

Cannot persist an entity within an integration test using the MongoDB GORM plugin

Context: I've created a new plugin named AppDomain that includes the Mongo 3.0.1 plugin. It has one domain class (Person), and one integration test (PersonSpec). Issue: The id is being generated. The appdomain database and person collection are…
Jason Stonebraker
  • 809
  • 1
  • 10
  • 11
1
vote
1 answer

Find method not working in GMongo using $gt greater and less than operands

I'm using the GMongo library in Groovy to read items from MongoDB. The CacheItem class is a simple object to hold cache items, and each item has an expiration time which is set at the time when it's added to the mongo. When I read items from mongo,…
raffian
  • 31,267
  • 26
  • 103
  • 174
1
vote
0 answers

Grails gorm-mongodb embedded objects

I have two mapped classes: BaseClass and ConcreteClass extends BaseClass, both are stored into same collections. Base class have an field, stored as embedded value - object with class Dimensions, that is configured as embedded by: class BaseClass { …
Igor Artamonov
  • 35,450
  • 10
  • 82
  • 113
1
vote
1 answer

Version property missing when converting Domain to JSON

In GORM-standalone I have a simple domain class like: @JsonIgnore( [ 'owner' ] ) class Person implements MongoEntity{ String id String name String owner Long version // attempt to hack } When an instance of Person is converted to…
injecteer
  • 20,038
  • 4
  • 45
  • 89
1
2 3 4