This week's book giveaway is in the Agile and Other Processes forum.
We're giving away four copies of Software Teaming: A Mob Programming, Whole-Team Approach and have Woody Zuill and Kevin Meadows on-line!
See this thread for details.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
  • Rob Spoor
  • Junilu Lacar
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Carey Brown
Bartenders:

saving object to mongo db but on retrieving data is not coming

 
Ranch Hand
Posts: 118
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello I m using node epress to save data in mongo db
actually It contains array of objects  containing image urls



on iterating I want to change image urls dynamically like
<image src" {{this.productUrls}}"/>

but I m receiving full object includes id bla abla I need to get only specific URL from mongo db like

<img src="sho.png"/>

<img src="cam.png"/> etc









 
Sheriff
Posts: 67693
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Well, yeah. If productUrls points to an object, you need to drill down to the reference(s) that contain the URL string(s).
 
Bartender
Posts: 653
14
TypeScript Fedora
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If you want list of only the image file names you can use map.

 
obaid abbassi
Ranch Hand
Posts: 118
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I m getting error using map method

If I inspect page source URLs are coming like

<img class="card-img-top img-fluid" src="{ url: 'headp.jpg', _id: new ObjectId("63496ef4ed64d5436e2fcc9e") },{ url: 'cam.jpg', _id: new ObjectId("63496ef4ed64d5436e2fcc9f") },{ url: 'sho.png', _id: new ObjectId("63496ef4ed64d5436e2fcca0") }" alt="Card image cap">
 
reply
    Bookmark Topic Watch Topic
  • New Topic