Starting Create/Update Comments

I seem to really be struggling with this ticket and I believe it may be due to a lack of conceptual understanding of what I’m to do (and how to do it!)
Are we supposed to create a document through lookup (join) and insert into comments? Kind of like the join from the previous ticket?

Hi @Robert_67632,

Not quite. No join required.

The task is in two parts; add_comment() and update_comment() functions.

add_comment():


Create a comment document that can be inserted into the comments collection using the fields defined above. I’ve created a mapping for you and highlighted the important sections. As for the user object, you need to look in the test_create_update_comments.py file to understand how to reference name and email.

update_comment():
This one is a straightforward update statement that needs to be constructed for the updateOne() method. The only thing to note is that the comment_id needs to be an object id.

2 Likes

Ok, thank you. It’s the referencing that has got me hung up, I will look at the reference test doc and try and get a solution during my lunch break today.

It worked fine for me, I am still receiving an error:

This means that it is trying to transform an object not a string right? When I look at lastupdated in compass, it’s a string.

I presume this ticket is now completed?
The question you’re now asking is for a different ticket. Suggest you create a new thread for this.

Sorry, you’re completely right. I’ll mark it as solved.