Last active
August 25, 2021 05:47
-
-
Save egoson/c339612f806a7111c130dcb8990f19ff to your computer and use it in GitHub Desktop.
MONGODB
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| user: [ | |
| { | |
| id: 1, | |
| name: 'Michel', | |
| }, | |
| { | |
| id: 2, | |
| name: 'Peter', | |
| }, | |
| { | |
| id: 3, | |
| name: 'Helen', | |
| } | |
| ] | |
| book: [ | |
| { | |
| id: 1, | |
| name: 'Book 1', | |
| ownerId: 1, | |
| color: 'red' | |
| }, | |
| { | |
| id: 2, | |
| name: 'Book 2', | |
| ownerId: 2, | |
| color: 'red' | |
| }, | |
| { | |
| id: 3, | |
| name: 'Book 3', | |
| ownerId: 2, | |
| color: 'blue' | |
| }, | |
| ] | |
| filter: { | |
| where: { | |
| // нужно найти всех пользователей у которых есть книги красного цвета. | |
| // То есть запрос должен вывести пользователя с id 1 и книгу с id 1 | |
| } | |
| } | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment