Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[[relate]] not working in monstache #732

Open
MihirSavjani opened this issue Sep 26, 2024 · 0 comments
Open

[[relate]] not working in monstache #732

MihirSavjani opened this issue Sep 26, 2024 · 0 comments

Comments

@MihirSavjani
Copy link

Hii, I'm trying to implement the [[relate]] feature in my project, but I'm not getting the expected output.

Here's the setup:

Database: test with two collections:

  1. users
    {
      "_id": "12345",
      "name": "demo"
    }
  2. orders
    {
      "_id": "456",
      "userId": "12345",
      "productName": "laptop"
    }

I want to include the name from the users collection in the orders records, based on the userId. Here's the configuration in my Monstache config file:

mongo-url = "mongodb://127.0.0.1:27018/test"
elasticsearch-urls = ["http://localhost:9300"]
change-stream-namespaces = ["test.users","test.orders"]
direct-read-namespaces = ["test.users","test.orders"]
enable-http-server = true
verbose = true

[[relate]]
namespace = "test.orders"
with-namespace = "test.users"
src-field = "userId"
match-field = "_id"
keep-src = true
dot-notation = true

I'm using Monstache version 6.7.17 and Elasticsearch version 7.10.0.

After syncing, this is the data I receive in Elasticsearch:

{
  "productName": "laptop",
  "userId": "12345"
}

It seems like the userName is not being added. Could you please help me figure out what might be going wrong?

Thank you in advance!

@MihirSavjani MihirSavjani changed the title [[relate]] not working [[relate]] not working in monstache Sep 26, 2024
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

No branches or pull requests

1 participant