Problems creating a Speckle stream using updated Speckle data

Good morning all,

I’ve got a question about creating a stream using the Speckle API and I’m hoping some one here can help me :smiley:

My plan is this:

  1. Take data from a speckle stream
  2. Add some property data
  3. Create a new stream using this updated data

The issue I’m facing is this:
If I try to create the stream using the stream data in step 3, I get an error of the object id already existing in MongoDB.

Do I need to make an ObjectCreate API call for each object in my updated stream data? If so how do I specify that that SpeckleObject is part of a specific stream?
I’ve also tried cloning the stream from step 1 and updating that, but it seems the cloned stream also uses the same ids for the cloned objects, resulting in both streams getting updated if I do an ObjectUpdate API call.

If any part of my question is unclear, please let me know!
Thanks.

Regards,

Daan

Try deleting the id and hash fields from each object first - let us know if that works out? The longer story: i suspect it’s because when you get an object from the server, it comes with its existing id, and 1.0 doesn’t do any server-side checks for hashing. When you add properties to an object, its id/hash should change. We enforce this in connectors, but 1.0 gives you too much control over this. Won’t be a hurdle in 2 :smiley:

Hi Dimitrie,

Thanks for your response :smiley:
I’m not able to test out your solution atm but I understand the issue.
I’ll reply back here after testing.