Replace_one's filter is returning a false positive match saying product3 matches the filter when in fact it does not. Oddly enough product 4 incorrectly udpdates (replaces) product 3, even though they have different productIDs. Product 3 correctly updates (replaces) product 1 Then product 3 is meant to duplicate 1 and 4 is meant to duplicate 2 to test non-duplication. This test included (test1) is also meant to test the /addone endpoint in products.py whose functionality is to add (upsert) the product if it does not already exist or update (replace) the existing if it does already exist. 8 of which are meant to be used in further tests I have not included in this repo because they are not important to reproduce the false positive bug I'm seeing. Therefore that's the filter I use when calling replace_one What happens: TLDR: It requires all three of these values to uniquely identify any product. To avoid locationID and productID collisions between these different businesses a foreignAPIauthority string is used to identify each businesses to seperate their namespaces. It is meant to manage store locations and products in these store from many different businesses. I'm creating a mock-up store inventory database. In the Server Configuration screen, keep the default values. ![]() In the Choose Setup Type screen, choose Complete. Read and accept the terms in license agreement. you may want to open a new terminal because the next step will soak up the existing terminal To get started, follow the steps below to install MongoDB: Download MongoDB Community Server from here.database/mongo docker-compose up -build -d The files needed from my project which reproduce the false positive filter issue in replace_one with upsert=True
0 Comments
Leave a Reply. |