mirror of
				https://github.com/openimsdk/open-im-server.git
				synced 2025-11-04 03:13:15 +08:00 
			
		
		
		
	fix:mgo delete err
This commit is contained in:
		
							parent
							
								
									9b32c630dc
								
							
						
					
					
						commit
						fd4f99fac2
					
				@ -167,6 +167,10 @@ func (u *UserMgo) DeleteUserCommand(ctx context.Context, userID string, Type int
 | 
				
			|||||||
	filter := bson.M{"userID": userID, "type": Type, "uuid": UUID}
 | 
						filter := bson.M{"userID": userID, "type": Type, "uuid": UUID}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	result, err := collection.DeleteOne(ctx, filter)
 | 
						result, err := collection.DeleteOne(ctx, filter)
 | 
				
			||||||
 | 
						// when err is not nil, result might be nil
 | 
				
			||||||
 | 
						if err != nil {
 | 
				
			||||||
 | 
							return errs.Wrap(err)
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
	if result.DeletedCount == 0 {
 | 
						if result.DeletedCount == 0 {
 | 
				
			||||||
		// No records found to update
 | 
							// No records found to update
 | 
				
			||||||
		return errs.Wrap(errs.ErrRecordNotFound)
 | 
							return errs.Wrap(errs.ErrRecordNotFound)
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user