lift-record

Lift store BigDecimal in MongoDB

纵然是瞬间 提交于 2019-12-23 05:14:39
问题 I am developing an ecommerce site in Lift with MongoDB I need to store some data for product prices My question is this: What field type should I use in MongoDB if I want to store data type BigDecimal In mapper is a field of type: MappedDecimal, but in net.liftweb.mongodb.record.field no equivalent How I can to store this information? Thank you all for your attention and help 回答1: As of MongoDB v2.6 there is no fixed-places decimal type. The data has to be saved in a field of a different type

Lift Record: empty value for required field but no validation errors

若如初见. 提交于 2019-12-12 04:41:16
问题 I've been trying to figure out how to do this without manually defining a validation but without any success so far. I have a StringField class Foo private() extends MongoRecord[Foo] with ObjectIdKey[Foo] { ... object externalId extends StringField(this, 255) { // none of these seem to have any effect on validation whatsoever: override def optional_? = false override def required_? = true override def defaultValueBox = Empty } ... } Now when I call .validate on a Foo , it returns no errors: