Skip to content

MongoDB Collections, Indices, and Keys

Alex Ayerdi edited this page Dec 14, 2015 · 23 revisions

Listings

Keys

FK From UserID to Accounts["UserId"]

Key Name Type
_id ObjectId (long int)
UserId (Optional) Guid
LandlordId (Deprecated) Guid
Price int
Address string
Unit string
Bedrooms int
Bathrooms int
HasAnimals bool
HasLaundry bool
HasParking bool
HasAirConditioning bool
LeaseType string
BuildingType string
StartDate IsoDate
WorldCoordinates object - {x (float), y (float)}
University string
Landlord string
IsRented bool
IsFeatured bool
IsPastThreshold bool

Accounts

Keys

Key Name Type
_id ObjectId (long int)
Username string
UserId Guid
LandlordId (Optional - Deprecated) Guid
FacebookId (Optional) string
PasswordHash string
FirstName string
LastName string
PhoneNumber string
Email string
IsActive bool
IsAdmin bool
IsVerified bool
IsLandlord bool

Renters

Keys

FK with UserID to Accounts["UserId"]

FK with LandlordID to Accounts["UserId"]

FK with UniversityID to Universities["UniversityId"]

Key Name Type
_id ObjectId (long int)
UserID string
LandlordID string
UniversityID string
Address string
Unit string
Rent string
HasPaidRent bool

Payments

Keys

FK with RenterID to Accounts["UserId"]

FK with LandlordID to Accounts["UserId"]

Key Name Type
_id ObjectId (long int)
RenterID string
LandlordID string
Rent int
Month string

Applicants

Keys

FK with ApplicantID to Accounts["UserId"]

FK with ListingID to Listings["_id"] (may want to actually add ListingID to Listings for unique GUID)

Key Name Type
_id ObjectId (long int)
ApplicantId string
ListingId string

Universities

Keys

Key Name Type
_id ObjectId (long int)
UniversityId string
UniversityName string
Address string
WorldCoordinates object - {x (float), y (float)}
Threshold float

Pricing

Keys

Key Name Type
_id ObjectId (long int)
UniversityId string
ListingMarkup string
FeaturedMarkup string