I tried using MongoDB 2.0.6 to replace MySQL 5.5.25 for the Grails 2.1 test application and ran into some weird issues.
Problems using MongoDB but not MySQL:
When using Scaffolding, I cannot get order fields using static constraints
When I specify inList as a constraint, I get a drop-down menu when using the MySQL backend, but a field when using the MongoDB backend.
No * (asterisk) in the fields where the restriction is indicated blank=false.
Domain Class :
package study
class Student {
String login
String firstName
String lastName
String gender
Boolean active
Date dateCreated
Date lastUpdated
static constraints = {
login()
firstName(blank: false)
lastName(blank: false)
gender(inList: ['M', 'F'])
active()
}
}
Controller
package study
class StudentController {
def scaffold = true
}
DataSource.groovy (MySQL stuff commented out):
grails {
mongo {
host = "dev-linux"
port = 27017
username = "study"
password= "********"
databaseName = "study"
}
}
BuildConfig.groovy ( , , MongoDB MySQL, Grails)
plugins {
// build ":hibernate:$grailsVersion"
// compile ":mysql-connectorj:5.1.12"
compile ":mongodb:1.0.0.GA"
build ":tomcat:$grailsVersion"
}
, MongoDB MySQL, - DataSource.groovy BuildConfig.groovy, .
- , ?
, - Nabble, MongoDB.
.
, , . , .
, .
- Grails + Scaffolding MongoDB ? - - ?
, .