@dhyasama/totem-models 10.21.1 → 10.21.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/CapTable.js +15 -7
- package/lib/Organization.js +1 -3
- package/lib/Person.js +1 -2
- package/lib/Round.js +3 -2
- package/package.json +1 -1
package/lib/CapTable.js
CHANGED
|
@@ -424,6 +424,8 @@ module.exports = function(mongoose, config) {
|
|
|
424
424
|
// combine provided and default options
|
|
425
425
|
options = _.defaults(options || {}, defaultOptions);
|
|
426
426
|
|
|
427
|
+
const path = 'stakeholders.name';
|
|
428
|
+
|
|
427
429
|
self.aggregate([
|
|
428
430
|
{
|
|
429
431
|
"$search": {
|
|
@@ -433,14 +435,11 @@ module.exports = function(mongoose, config) {
|
|
|
433
435
|
{
|
|
434
436
|
text: {
|
|
435
437
|
query: value,
|
|
436
|
-
path:
|
|
437
|
-
'stakeholders.name'
|
|
438
|
-
],
|
|
438
|
+
path: path,
|
|
439
439
|
fuzzy: {
|
|
440
440
|
maxEdits: options.maxEdits,
|
|
441
441
|
maxExpansions: options.maxExpansions
|
|
442
|
-
}
|
|
443
|
-
score: { boost: { value: 3 } }
|
|
442
|
+
}
|
|
444
443
|
}
|
|
445
444
|
}
|
|
446
445
|
],
|
|
@@ -453,16 +452,25 @@ module.exports = function(mongoose, config) {
|
|
|
453
452
|
}
|
|
454
453
|
],
|
|
455
454
|
minimumShouldMatch: 1
|
|
455
|
+
},
|
|
456
|
+
highlight: {
|
|
457
|
+
path: path
|
|
456
458
|
}
|
|
457
459
|
}
|
|
458
460
|
},
|
|
459
461
|
{
|
|
460
462
|
$limit: options.limit,
|
|
461
463
|
},
|
|
464
|
+
{
|
|
465
|
+
$addFields: {
|
|
466
|
+
name: "$stakeholders.name"
|
|
467
|
+
}
|
|
468
|
+
},
|
|
462
469
|
{
|
|
463
470
|
$project: {
|
|
464
|
-
|
|
465
|
-
score: { $meta: "searchScore" }
|
|
471
|
+
name: 1,
|
|
472
|
+
score: { $meta: "searchScore" },
|
|
473
|
+
highlights: { $meta: "searchHighlights" }
|
|
466
474
|
}
|
|
467
475
|
}
|
|
468
476
|
]).exec(cb);
|
package/lib/Organization.js
CHANGED
|
@@ -2071,7 +2071,6 @@ module.exports = function(mongoose, config) {
|
|
|
2071
2071
|
const path = [
|
|
2072
2072
|
'name',
|
|
2073
2073
|
'aliases',
|
|
2074
|
-
'website',
|
|
2075
2074
|
'websiteAliases',
|
|
2076
2075
|
'stakeholders'
|
|
2077
2076
|
];
|
|
@@ -2085,8 +2084,7 @@ module.exports = function(mongoose, config) {
|
|
|
2085
2084
|
{
|
|
2086
2085
|
text: {
|
|
2087
2086
|
query: value,
|
|
2088
|
-
path: path
|
|
2089
|
-
score: { boost: { value: 3 } }
|
|
2087
|
+
path: path
|
|
2090
2088
|
}
|
|
2091
2089
|
}
|
|
2092
2090
|
],
|
package/lib/Person.js
CHANGED
package/lib/Round.js
CHANGED
|
@@ -618,7 +618,7 @@ module.exports = function(mongoose, config) {
|
|
|
618
618
|
let query = self.find({ 'vehicles.fund': { $in: fundIds } });
|
|
619
619
|
|
|
620
620
|
query.select('organization');
|
|
621
|
-
query.populate('organization', 'name');
|
|
621
|
+
query.populate('organization', 'name people');
|
|
622
622
|
|
|
623
623
|
query.exec(function(err, rounds) {
|
|
624
624
|
|
|
@@ -639,7 +639,8 @@ module.exports = function(mongoose, config) {
|
|
|
639
639
|
|
|
640
640
|
portfolio.push({
|
|
641
641
|
_id: rounds[0].organization._id,
|
|
642
|
-
name: rounds[0].organization.name
|
|
642
|
+
name: rounds[0].organization.name,
|
|
643
|
+
people: rounds[0].organization.people
|
|
643
644
|
});
|
|
644
645
|
|
|
645
646
|
});
|