Product Image depending on scan

I have a page with scan funktion. I can get name, number, product and so on from the database when a scan the product with barcode scanner. I have a database with a collection named products. In the products collection a have Name, product_category and code. I also have product_image where i have uplod images. Ok to the problem. I want to scan a code on a product. It working so a get the right code, name och product_category in a page in the app. Now a want to present the right image when a scan the product. Depending on the scan of a code the right product should show with the right image...i have a JaveScript that get the image from the colection, that works but can a get the rught image depending on the code scan?
1 person has
this question