The point of this task is to be able to define a file in ./models/ whose name corresponds with a MongoCollection. With that, we should be able to generate JSON objects to insert into the aforementioned collection for testing and development environments for all Mongo objects.
See documentation for importing objects into a Mongo DiscType collection. Do import in your test environment.
See ./dal/Mongo line 80. During the initialization from Mongo, it will load models from ./models/ where the filename equals the name of the Mongo collection.
See ./lib/Fixture, the commented out MongoObj function. It should use ColumnFixture ( should probably be renamed to AttributeFixture ), to generate values for each attribute in the ./models/Disc model.
Update ./lib/ColumnFixture ( feel free to rename ) so that it can handle the types I have described in./models/Disc. Note that for foreign keys, you can assume that the referenced Collection has at least one object ( same as Postgres ). Please use theloremflickrurl in order to generate random image urls ( move./lib/Fixture's Photo method out of./libFixture` )
Remove ./models/DiscTypeFactory and update ./scripts/createDiscs:
The point of this task is to be able to define a file in
./models/
whose name corresponds with a MongoCollection. With that, we should be able to generate JSON objects to insert into the aforementioned collection for testing and development environments for all Mongo objects.Please note the top level README, as well as one for most of the files in [./lib]((https://github.com/cbaron/Hazy/tree/ecommerce/lib#library)
See documentation for importing objects into a Mongo
DiscType
collection. Do import in your test environment.See
./dal/Mongo
line 80. During the initialization from Mongo, it will load models from./models/
where the filename equals the name of the Mongo collection.See
./lib/Fixture
, the commented outMongoObj
function. It should useColumnFixture
( should probably be renamed to AttributeFixture ), to generate values for each attribute in the./models/Disc
model.Update
./lib/ColumnFixture ( feel free to rename ) so that it can handle the types I have described in
./models/Disc. Note that for foreign keys, you can assume that the referenced Collection has at least one object ( same as Postgres ). Please use the
loremflickrurl in order to generate random image urls ( move
./lib/Fixture's Photo method out of
./libFixture` )Remove
./models/DiscTypeFactory
and update./scripts/createDiscs
:becomes