From 6e5c90d7abdf8cda9fd8ab0fc78637abcbfddf41 Mon Sep 17 00:00:00 2001 From: Raiyan Kamal Date: Sat, 18 Jun 2016 08:28:47 -0400 Subject: [PATCH] Documented max, min limits of String type and reorganized the example --- README.md | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 341ba68..4505061 100644 --- a/README.md +++ b/README.md @@ -140,12 +140,19 @@ Selects a random element from provided array. Returns a random object created from [SimpleSchema](http://github.com/aldeed/meteor-simple-schema) definition. +Only `Number`, `String` and `Boolean` type fields are supported at the moment. The `max` and `min` options are respected for `Number` and `String` type. + *Example:* BookSchema = new SimpleSchema({ title: { type: String }, + summary: { + type: String + max: 1000, + min: 100 + } pages: { type: Number }, @@ -159,11 +166,16 @@ Returns a random object created from [SimpleSchema](http://github.com/aldeed/met } }); var fakeDoc = Fake.simpleSchemaDoc(BookSchema); - // { "title": "Tendy Orbiter", "pages": 112, "available": true, "price": 42 } -Only `Number`, `String` and `Boolean` type fields are supported at the moment. +output: -The `max` and `min` options are respected for `Number` type. + { + "title": "Orlycon ingcal tion comingedthe modecomal detion reed n.", + "summary": "Ybecom perdythe cona ananed re de esni modiloalse.Ygen teres ble nesso ic.E es conesmo acor tyex.", // max and min limit respected + "pages": 5721755277461235, // very big number is likely to appear since max and min limits were specified for this field + "available": true, + "price": 93 // max and min limit respected + } ## History