Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Java
  4. How to update nested Array in Spring boot mongodb

How to update nested Array in Spring boot mongodb

Scheduled Pinned Locked Moved Java
javadatabasemongodbdata-structurestutorial
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    devTUapp
    wrote on last edited by
    #1

    Query query = new Query();
    query.addCriteria(Criteria.where("serviceCentreId").is(requestNumber)
    .and("serviceSlots")
    .elemMatch(Criteria.where("date").is(serviceRequestBean.getServiceSlot().get(0).getDate())
    .and("slotBegin").is(serviceRequestBean.getServiceSlot().get(0).getSlotBegin())
    .and("slotEnd").is(serviceRequestBean.getServiceSlot().get(0).getSlotEnd())
    .and("slotBooked")
    .elemMatch(Criteria.where("serviceRqId").is(serviceRequestBean.getServiceSlot().get(0).getSlotBooked().get(0).getServiceRqId())
    )));

    	Update update = new Update();
    	update.set("serviceSlots.$\[i\].slotBooked.$\[j\].status", "Confirm")
    

    how to write filterArray for this

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups