Facing issue on loading json data in weaviate

class schema = {
        "class": "auditlog",
        "vectorizer": "text2vec-openai",
        # If set to "none" you must always provide vectors yourself. Could be any other "text2vec-*" also.
        "moduleConfig": {
            "text2vec-openai": {
                "model": "ada",
                "modelVersion": "002",
                "type": "text",
            },
            "generative-openai": {
                "model": "gpt-4"
            }  # Ensure the `generative-openai` module is used for generative queries
        }
    }

while adding the data object in class

 client.batch.configure(batch_size=50)  # Configure batch
    with client.batch as batch:  # Initialize a batch process
        for i, d in enumerate(result):  # Batch import data
            print(f"importing object: {i + 1}")
            # properties = {
            #     # "inward_date": d["inward_date"],
            #     "category": d["category"],
            #     "action": d["action"],
            #     "previous": d["previous"],
            #     "date": d["date"],
            #     "user_details": d["user_details"]
            # }
            batch.add_data_object(
                data_object=d,
                class_name="auditlog"
            )

i face issue that
{‘error’: [{‘message’: “‘id’ is a reserved property name, invalid object property ‘previous’ on class ‘Auditlog’: object must be a map, but got: interface {}”}]}

[
  {
    "id": 583,
    "category": "Product",
    "category_id": 51,
    "action": 'Product "US2-SH" Updated !',
    "previous": [
      {
        "created_at": "2023-10-26T03:35:14.140Z",
        "updated_at": "2023-10-26T03:35:14.140Z",
        "id": 51,
        "discount": "0",
        "label": "US2-SH",
        "product_name": "US2-SH",
        "Hsn": 8515100,
        "cgst": "9",
        "sgst": "9",
        "igst": "18",
        "rate": "1159175",
        "status": true,
        "description": "Custom designated sonic probe platform for placement of 16 sonicators with equi-distance arrangements without induction. includes all the insulation of the 16 sonicators and cooling arrangements",
        "sub_description": "",
        "type": "Goods"
      }
    ],
    "diff": {
      "created_at": "2023-10-26T03:35:14.140Z",
      "updated_at": "2023-10-26T04:17:30.748Z",
      "id": 51,
      "discount": "0",
      "label": "US2-SH",
      "product_name": "US2-SH",
      "Hsn": 8515100,
      "cgst": "9",
      "sgst": "9",
      "igst": "18",
      "rate": "1159175",
      "status": true,
      "description": "Custom designated sonic probe platform for placement of 16 sonicators with equi-distance arrangements without induction. includes all the insulation of the 16 sonicators and cooling arrangements",
      "sub_description": "",
      "type": "Goods"
    },
    "date": "2023/10/26",
    "status": true,
    "created_at": "2023-10-26 09:47:30.761000",
    "updated_at": "2023-10-26 09:47:30.761000",
    "user_details": "admin@nvpl.com"
  }
]

Hi! Welcome to our community :hugs: !

Your d dict probably has an id key, which is a reserved name:

You will probably have to uncomment the properties variable declaration and use it instead.

Also, FYI, the class name gets capitalized, so to avoid errors when getting back results, try always using, in your case, Auditolog, instead of auditlog :slight_smile:

Let me know if that helps!

Thanks!