I use mongoengine with Django and python.
This is my code:
class Chambre(EmbeddedDocument):
max_personne = IntField(default=0)
prix = IntField(default=0)
class Hotel(Document):
code = IntField(default=0)
nom = StringField(max_length=200)
chambre = ListField(EmbeddedDocumentField(Chambre))
resume = StringField(max_length=200)
1 - I want a query to filter all Hotel that have at least a Chambre with prix >= a (a floeat number)
2 - also have that Chambre
Any idea?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…