Skip to content

Conversation

@GGn0
Copy link
Collaborator

@GGn0 GGn0 commented Jul 15, 2021

Data sample proposal to Fix #7

@GGn0 GGn0 requested review from Raffone17, alv67, gmacario and gteti July 15, 2021 14:16
@GGn0
Copy link
Collaborator Author

GGn0 commented Jul 15, 2021

books.txt
authors.txt
You can use these two slightly modified files with mongoimport to view the data on your mongo instance
Also try this aggregation pipeline:

[
    {
      $match: {
        location: "Attic"
      }
    },
    {
      $lookup: {
        from: 'authors',
        localField: 'authors',
        foreignField: '_id',
        as: 'auths'
      }
    },
    {
      $project: {
        'title': 1,
        'authors': {$concatArrays: '$auths.name'},
        'generes': 1,
        'location': 1,
        'owner': 1,
        'reading': 1
      }
    }
]

@gmacario
Copy link
Collaborator

LGTM

Copy link
Collaborator

@gmacario gmacario left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LVGTM

Copy link
Collaborator

@alv67 alv67 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Starting from here is ok, modification request will eventually come as a task request.

@gmacario gmacario merged commit 9f70f66 into aquariophilie:main Jul 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Define database collections

3 participants