How do i write the query to select records 100 - 199 in a Mongo db.

How would i write the query in Mongo db to select records 100 through 199 only.

Thank you.
bmanmike39Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Mike EghtebasDatabase and Application DeveloperCommented:
What are your table name and column names. Based on which column you want to sort (after which you want 100 through 199).

Without order by a column, there is no guarantied  row order.
0
bmanmike39Author Commented:
Collection Name is Members

Column _id
memNumber
FName
LName
ClassNumber
email
0
Mike EghtebasDatabase and Application DeveloperCommented:
This code works in SQL Server. Most likely it will work in your database as well because all of them follow standard SLQ.
SELECT Column _id
          , memNumber
          , FName
          , LName
          , ClassNumber
          , email
FROM Members 
ORDER BY Column _id OFFSET 100 ROWS FETCH NEXT 99 ROWS ONLY;

Open in new window


Give this a try to see if it works.

Mike
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

bmanmike39Author Commented:
not it didn't work
0
IrogSintaCommented:
I'm not a Mongo user but after a quick bit of research, I found that Mongo is a NoSQL database.  I also came across a tutorial that was very helpful.  Try this out and see if it gives you what you want:
db.Members.find().limit(100).skip(99);

Open in new window

or the following for a different view:
db.Members.find().limit(100).skip(99).pretty();

Open in new window


In case you're interested, here's a link to the Mongo tutorial:
Mongo Tutorial

Ron
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
bmanmike39Author Commented:
Thanks! that was it.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Query Syntax

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.