0

How can I swap the position of two documents in mongoose model. I can also delievier documents _id's if necessary.

var Schema = mongoose.Schema({
  //my prop
});

mongoose.model('Job', Schema);

swap(index1,index2) 
{
   Job... //swap
}

Thank you all in advance.

azulay7
  • 305
  • 3
  • 16
  • https://stackoverflow.com/questions/22327066/swap-the-values-in-a-mongodb-array?utm_medium=organic&utm_source=google_rich_qa&utm_campaign=google_rich_qa – Rohit Shukla Apr 30 '18 at 05:35
  • Hi, @RohitShukla in the link you've attached, it's a different problem. he want to swap item within a document property "geo". I want to swap items within a monogo collection. – azulay7 Apr 30 '18 at 07:16

0 Answers0