I have integrated the $lookup
operator from MongoDB into my Meteor collection using the tunguska:reactive-aggregate
package obtained from AtmosphereJs (). Below is an example of how I implemented it following the package documentation:
import { ReactiveAggregate } from 'meteor/tunguska:reactive-aggregate';
Meteor.publish("orders", function () {
ReactiveAggregate(this, OrdersCollection, [{
$lookup: {
from: "customers",
localField: "customer_id",
foreignField: "wooCommerce_id",
as: "customerInfo"
}
}]);
})
The integration works seamlessly, and I successfully retrieve the customer's information in the customerInfo
field of the collection. However, when TypeScript compiler comes into play, it raises an error as follows:
error TS2307: Cannot find module "meteor/tunguska:reactive-aggregate"
This issue seems to be related to including the package correctly within the project. Perhaps there is a need to add the package to the list of "detected" ones similar to importing other packages like meteor/check
. Despite the app functioning as intended, having errors flagged in the IDE can be bothersome...
Your suggestions or solutions will be greatly appreciated!