@@ -52,85 +52,178 @@ export const MongoDBFieldTypeValues: MongoDBFieldType[] = [
5252 */
5353export const MONGO_TYPE_TO_FAKER_METHODS : Record <
5454 MongoDBFieldType ,
55- Array < string >
55+ Array < { method : string ; description ?: string } >
5656> = {
5757 String : [
58- 'lorem.word' ,
59- 'lorem.words' ,
60- 'lorem.sentence' ,
61- 'lorem.paragraph' ,
62- 'person.firstName' ,
63- 'person.lastName' ,
64- 'person.fullName' ,
65- 'person.jobTitle' ,
66- 'internet.displayName' ,
67- 'internet.email' ,
68- 'internet.emoji' ,
69- 'internet.password' ,
70- 'internet.url' ,
71- 'internet.domainName' ,
72- 'internet.userName' ,
73- 'phone.number' ,
74- 'location.city' ,
75- 'location.country' ,
76- 'location.streetAddress' ,
77- 'location.zipCode' ,
78- 'location.state' ,
79- 'company.name' ,
80- 'company.catchPhrase' ,
81- 'color.human' ,
82- 'commerce.productName' ,
83- 'commerce.department' ,
84- 'finance.accountName' ,
85- 'finance.currencyCode' ,
86- 'git.commitSha' ,
87- 'string.uuid' ,
88- 'string.alpha' ,
89- 'string.alphanumeric' ,
90- 'system.fileName' ,
91- 'system.filePath' ,
92- 'system.mimeType' ,
93- 'book.title' ,
94- 'music.songName' ,
95- 'food.dish' ,
96- 'animal.type' ,
97- 'vehicle.model' ,
98- 'hacker.phrase' ,
99- 'science.chemicalElement' ,
58+ { method : 'lorem.word' , description : 'Single word' } ,
59+ { method : 'lorem.words' , description : 'Multiple words' } ,
60+ { method : 'lorem.sentence' , description : 'Short sentence' } ,
61+ { method : 'lorem.paragraph' , description : 'Paragraph of text' } ,
62+ { method : 'person.firstName' } ,
63+ { method : 'person.lastName' } ,
64+ { method : 'person.fullName' } ,
65+ { method : 'person.jobTitle' } ,
66+ {
67+ method : 'internet.displayName' ,
68+ description : 'Username-style display name' ,
69+ } ,
70+ { method : 'internet.email' } ,
71+ { method : 'internet.emoji' } ,
72+ { method : 'internet.password' , description : 'Randomly generated password' } ,
73+ { method : 'internet.url' } ,
74+ { method : 'internet.domainName' } ,
75+ { method : 'internet.userName' } ,
76+ { method : 'phone.number' } ,
77+ { method : 'location.city' } ,
78+ { method : 'location.country' } ,
79+ { method : 'location.streetAddress' } ,
80+ { method : 'location.zipCode' } ,
81+ { method : 'location.state' } ,
82+ { method : 'company.name' } ,
83+ {
84+ method : 'company.catchPhrase' ,
85+ description : 'Corporate-style marketing slogan' ,
86+ } ,
87+ { method : 'color.human' , description : 'Human-readable color name' } ,
88+ {
89+ method : 'commerce.productName' ,
90+ description : 'Product name from a commerce catalog' ,
91+ } ,
92+ {
93+ method : 'commerce.department' ,
94+ description : 'Commerce category or department name' ,
95+ } ,
96+ {
97+ method : 'finance.accountName' ,
98+ description : 'Financial account type or name' ,
99+ } ,
100+ {
101+ method : 'finance.currencyCode' ,
102+ description : 'ISO 4217 currency code like USD or EUR' ,
103+ } ,
104+ { method : 'git.commitSha' , description : 'Git commit SHA hash' } ,
105+ { method : 'string.uuid' } ,
106+ { method : 'string.alpha' , description : 'Alphabetic string' } ,
107+ { method : 'string.alphanumeric' , description : 'Alphanumeric string' } ,
108+ {
109+ method : 'system.fileName' ,
110+ description : 'File name with optional extension' ,
111+ } ,
112+ { method : 'system.filePath' , description : 'System-like file path' } ,
113+ {
114+ method : 'system.mimeType' ,
115+ description : 'MIME type string like image/png' ,
116+ } ,
117+ { method : 'book.title' } ,
118+ { method : 'music.songName' } ,
119+ { method : 'food.dish' } ,
120+ { method : 'animal.type' } ,
121+ { method : 'vehicle.model' } ,
122+ { method : 'hacker.phrase' , description : 'Hacker-style phrase' } ,
123+ {
124+ method : 'science.chemicalElement' ,
125+ description : 'Chemical element with name and symbol' ,
126+ } ,
100127 ] ,
128+
101129 Number : [
102- 'number.binary' ,
103- 'number.octal' ,
104- 'number.hex' ,
105- 'commerce.price' ,
106- 'date.weekday' ,
107- 'internet.port' ,
108- 'number.int' ,
109- 'number.float' ,
110- 'finance.amount' ,
111- 'location.latitude' ,
112- 'location.longitude' ,
130+ { method : 'number.binary' , description : 'Binary number string' } ,
131+ { method : 'number.octal' , description : 'Octal number string' } ,
132+ { method : 'number.hex' , description : 'Hexadecimal number string' } ,
133+ { method : 'commerce.price' , description : 'Monetary price with decimals' } ,
134+ { method : 'date.weekday' , description : 'Day of the week' } ,
135+ { method : 'internet.port' , description : 'Network port number' } ,
136+ { method : 'number.int' } ,
137+ { method : 'number.float' } ,
138+ {
139+ method : 'finance.amount' ,
140+ description : 'Monetary amount as number or string' ,
141+ } ,
142+ { method : 'location.latitude' } ,
143+ { method : 'location.longitude' } ,
144+ ] ,
145+
146+ Int32 : [
147+ { method : 'number.int' } ,
148+ { method : 'finance.amount' , description : 'Monetary amount as integer' } ,
149+ ] ,
150+
151+ Long : [
152+ { method : 'number.int' } ,
153+ { method : 'number.bigInt' , description : 'Large integer value as bigint' } ,
154+ ] ,
155+
156+ Decimal128 : [
157+ { method : 'number.float' } ,
158+ { method : 'finance.amount' , description : 'Decimal-style monetary amount' } ,
113159 ] ,
114- Int32 : [ 'number.int' , 'finance.amount' ] ,
115- Long : [ 'number.int' , 'number.bigInt' ] ,
116- Decimal128 : [ 'number.float' , 'finance.amount' ] ,
117- Boolean : [ 'datatype.boolean' ] ,
160+
161+ Boolean : [ { method : 'datatype.boolean' } ] ,
162+
118163 Date : [
119- 'date.recent' ,
120- 'date.past' ,
121- 'date.future' ,
122- 'date.anytime' ,
123- 'date.birthdate' ,
164+ { method : 'date.recent' , description : 'Date within the last few days' } ,
165+ { method : 'date.past' , description : 'Past date relative to now' } ,
166+ { method : 'date.future' , description : 'Future date relative to now' } ,
167+ { method : 'date.anytime' , description : 'Date at any time in history' } ,
168+ { method : 'date.birthdate' } ,
169+ ] ,
170+
171+ Timestamp : [
172+ { method : 'date.recent' } ,
173+ { method : 'date.past' } ,
174+ { method : 'date.future' } ,
175+ { method : 'date.anytime' } ,
176+ ] ,
177+
178+ ObjectId : [
179+ {
180+ method : 'database.mongodbObjectId' ,
181+ description : 'Valid MongoDB ObjectId string' ,
182+ } ,
124183 ] ,
125- Timestamp : [ 'date.recent' , 'date.past' , 'date.future' , 'date.anytime' ] ,
126- ObjectId : [ 'database.mongodbObjectId' ] ,
127- Binary : [ 'string.hexadecimal' , 'string.binary' ] ,
128- RegExp : [ 'lorem.word' , 'string.alpha' ] ,
129- Code : [ 'lorem.sentence' , 'lorem.paragraph' , 'git.commitMessage' ] ,
130- MinKey : [ 'number.int' ] ,
131- MaxKey : [ 'number.int' ] ,
132- Symbol : [ 'lorem.word' , 'string.symbol' ] ,
133- DBRef : [ 'database.mongodbObjectId' ] ,
184+
185+ Binary : [
186+ {
187+ method : 'string.hexadecimal' ,
188+ description : 'Hexadecimal string representation' ,
189+ } ,
190+ { method : 'string.binary' , description : 'Binary string representation' } ,
191+ ] ,
192+
193+ RegExp : [ { method : 'lorem.word' } , { method : 'string.alpha' } ] ,
194+
195+ Code : [
196+ {
197+ method : 'lorem.sentence' ,
198+ description : 'Short line of code' ,
199+ } ,
200+ { method : 'lorem.paragraph' , description : 'Block of placeholder code' } ,
201+ { method : 'git.commitMessage' , description : 'Git-style commit message' } ,
202+ ] ,
203+
204+ MinKey : [
205+ {
206+ method : 'number.int' ,
207+ description : 'Integer representing minimal key value' ,
208+ } ,
209+ ] ,
210+
211+ MaxKey : [
212+ {
213+ method : 'number.int' ,
214+ description : 'Integer representing maximal key value' ,
215+ } ,
216+ ] ,
217+
218+ Symbol : [
219+ { method : 'lorem.word' } ,
220+ {
221+ method : 'string.symbol' ,
222+ description : 'Symbol character such as punctuation or currency' ,
223+ } ,
224+ ] ,
225+
226+ DBRef : [ { method : 'database.mongodbObjectId' } ] ,
134227} ;
135228
136229export const DEFAULT_CONNECTION_STRING_FALLBACK = '<connection-string>' ;
0 commit comments