content_image/685250.jpg
+------+-----------+-------------+----------+-----------------------------+ 1 row in set (0.00 sec) 

## Related Information 

## 20.3.4.4 Delete Tables 

•See TableUpdateFunction for the full syntax definition. 

You can use the delete()  method to remove some or all records from a table in a database. The X DevAPI provides additional methods to use with the delete()  method to filter and order the records to be deleted. 

## Delete Records Using Conditions 

The following example passes search conditions to the delete()  method. All records matching the condition are deleted from the city table. In this example, one record matches the condition. 

## Delete the First Record 

mysql-js> db.city.delete().where("Name = ’Olympia’") 

To delete the first record in the city table, use the limit()  method with a value of 1. 

## Delete All Records in a Table 

mysql-js> db.city.delete().limit(1) 

You can delete all records in a table. To do so, use the delete()  method without specifying a search condition. 

## Drop a Table 

<img src='content_image/685250.jpg'>

## Caution 

Use care when you delete records without specifying a search condition; doing so deletes all records from the table. 

The dropCollection()  method is also used in MySQL Shell to drop a relational table from a database. For example, to drop the citytest  table from the world_x  database, issue: 

## Related Information 

mysql-js> session.dropCollection("world_x", "citytest") 

•See TableDeleteFunction for the full syntax definition. 

•See Section 20.3.2, “Download and Import world_x Database”  for instructions to recreate the world_x database. 

## 20.3.5 Documents in Tables 

In MySQL, a table may contain traditional relational data, JSON values, or both. You can combine traditional data with JSON documents by storing the documents in columns having a native JSON  data type. 

Examples in this section use the city table in the world_x  schema. 

