1

My database has 2 collections : Cell(_id, segment_id, cell_id) and SegmentSpeed(_id, segment_id, speed) And I want to perform the query below (sql format) in Java :

"Select * From SegmentSpeed Where segment_id in (Select segment_id From Cell Where cell_id>5)"

That is Mysql query, and the problem is I want to execute this query with MongoDb format in JAVA.

Thanks !

1 Answer 1

1

MongoDB does not support joins.

You may have to resort to some clunky and inefficient map-reduce operations if you are unable to change your schema.

What you can do is embed the whole SegmentSpeed inside a document of Cell.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.