My FeedDiscussionsHashnode Enterprise
New
Sign in
Log inSign up
Learn more about Hashnode Headless CMSHashnode Headless CMS
Collaborate seamlessly with Hashnode Headless CMS for Enterprise.
Upgrade ✨Learn more

i have multiple array of name invite which contain user object ,now i have to sort invite array on the basis of user length

Dev ashish Vats's photo
Dev ashish Vats
·Apr 25, 2019

{ "_id": ObjectId("5cc00870e273d731b779ff1d"), "invite":[ { "_id" : ObjectId("5cc00870e273d731b779ff1d"), "userId" : "5cbda29aae003b18b03acb52" }, { "_id" : ObjectId("5cc00870e273d731b779ff1d"), "userId" : "5cbda29aae003b18b03acb52" } ]}, { "_id": ObjectId("5cc00860e273d731b779ff1d"), "invite":[ { "_id" : ObjectId("5cc00870e273d731b779ff1d"), "userId" : "5cbda29aae003b18b03acb52" }, { "_id" : ObjectId("5cc00870e273d731b779ff1d"), "userId" : "5cbda29aae003b18b03acb52" }, { "_id" : ObjectId("5cc00870e273d731b779ff1d"), "userId" : "5cbda29aae003b18b03acb52" }] }