--
--
Lift, the simply functional web framework: http://liftweb.net
Code: http://github.com/lift
Discussion: http://groups.google.com/group/liftweb
Stuck? Help us help you: https://www.assembla.com/wiki/show/liftweb/Posting_example_code
Isn't it "_id" instead of "id"?
Chas.
W dniu poniedzia�ek, 24 wrze�nia 2012 08:46:57 UTC+2 u�ytkownik chasm napisa�:
Isn't it "_id" instead of "id"?
Chas.
im using ObjectIdPk:
�package code.model
import _root_.net.liftweb.record.field._import net.liftweb.mongodb.record._import net.liftweb.mongodb.record.field.ObjectIdPk
class Delegacja private() extends MongoRecord[Delegacja] with ObjectIdPk[Delegacja]{
ďż˝ def meta = Delegacja
ďż˝ object gdzie_od1 extends StringField(this, 30)ďż˝ object gdzie_do1 extends StringField(this, 30)ďż˝ object data_od1 extends StringField(this, 500)ďż˝ object data_do1 extends StringField(this, 500)
}
object Delegacja extends Delegacja with MongoMetaRecord[Delegacja]
so its id..
When im listing values from database, i list id too :
�def showAll(xhtml:NodeSeq):NodeSeq={� � page.flatMap(del => {� � � ("gdzie_od1" #> del.gdzie_od1 &� � � "gdzie_do1" #> del.gdzie_do1 &� � � "id" #> del.id &� � � "a [href]" #> "/item/view/%s".format(� � � � del.id.toString)� � � ).apply(xhtml)� � � })} �
and id works fine.
--
--
Lift, the simply functional web framework: http://liftweb.net
Code: http://github.com/lift
Discussion: http://groups.google.com/group/liftweb
Stuck? Help us help you: https://www.assembla.com/wiki/show/liftweb/Posting_example_code
ďż˝
ďż˝
ďż˝
Ah mean while I get answer:
need new import:
import org.bson.types.ObjectId
And :
val items = Delegacja.find("_id", new ObjectId(id))
This is the needed conersion ;]
--