I am currently working on an App using Ionic 2 and MEAN Stack. The App has a module that allows users to sell stuff such as unused furniture, books, etc… I have set up a products collection and product images collection in Mongo so that users can add product details and images as well. While this sounds simple, I am not able to implement it technically, The following is the approach,
User first selects the category and writes item description and uploads images. WHen he clicks post item,
I am first saving the product details in the products collection, getting the _id of the inserted product, and then using cordova file transfer, I am transfering the file using Multer in node js and from there my idea is to add the image with the product id (_id) to mongo… I am not able to do this in a single call … the code works fine individually… but all in one shot is a problem with the promises…
Did anyone implement something like this and some can guide me ?